/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    'cn-qingdao' = 'adb.aliyuncs.com',
    'cn-beijing' = 'adb.aliyuncs.com',
    'cn-hangzhou' = 'adb.aliyuncs.com',
    'cn-shanghai' = 'adb.aliyuncs.com',
    'cn-shenzhen' = 'adb.aliyuncs.com',
    'cn-hongkong' = 'adb.aliyuncs.com',
    'ap-southeast-1' = 'adb.aliyuncs.com',
    'us-west-1' = 'adb.aliyuncs.com',
    'us-east-1' = 'adb.aliyuncs.com',
    'cn-hangzhou-finance' = 'adb.aliyuncs.com',
    'cn-north-2-gov-1' = 'adb.aliyuncs.com',
    'ap-northeast-2-pop' = 'adb.ap-northeast-1.aliyuncs.com',
    'cn-beijing-finance-1' = 'adb.aliyuncs.com',
    'cn-beijing-finance-pop' = 'adb.aliyuncs.com',
    'cn-beijing-gov-1' = 'adb.aliyuncs.com',
    'cn-beijing-nu16-b01' = 'adb.aliyuncs.com',
    'cn-edge-1' = 'adb.aliyuncs.com',
    'cn-fujian' = 'adb.aliyuncs.com',
    'cn-haidian-cm12-c01' = 'adb.aliyuncs.com',
    'cn-hangzhou-bj-b01' = 'adb.aliyuncs.com',
    'cn-hangzhou-internal-prod-1' = 'adb.aliyuncs.com',
    'cn-hangzhou-internal-test-1' = 'adb.aliyuncs.com',
    'cn-hangzhou-internal-test-2' = 'adb.aliyuncs.com',
    'cn-hangzhou-internal-test-3' = 'adb.aliyuncs.com',
    'cn-hangzhou-test-306' = 'adb.aliyuncs.com',
    'cn-hongkong-finance-pop' = 'adb.aliyuncs.com',
    'cn-qingdao-nebula' = 'adb.aliyuncs.com',
    'cn-shanghai-et15-b01' = 'adb.aliyuncs.com',
    'cn-shanghai-et2-b01' = 'adb.aliyuncs.com',
    'cn-shanghai-finance-1' = 'adb.aliyuncs.com',
    'cn-shanghai-inner' = 'adb.aliyuncs.com',
    'cn-shanghai-internal-test-1' = 'adb.aliyuncs.com',
    'cn-shenzhen-finance-1' = 'adb.aliyuncs.com',
    'cn-shenzhen-inner' = 'adb.aliyuncs.com',
    'cn-shenzhen-st4-d01' = 'adb.aliyuncs.com',
    'cn-shenzhen-su18-b01' = 'adb.aliyuncs.com',
    'cn-wuhan' = 'adb.aliyuncs.com',
    'cn-yushanfang' = 'adb.aliyuncs.com',
    'cn-zhangbei-na61-b01' = 'adb.aliyuncs.com',
    'cn-zhangjiakou-na62-a01' = 'adb.aliyuncs.com',
    'cn-zhengzhou-nebula-1' = 'adb.aliyuncs.com',
    'eu-west-1-oxs' = 'adb.ap-northeast-1.aliyuncs.com',
    'me-east-1' = 'adb.ap-northeast-1.aliyuncs.com',
    'rus-west-1-pop' = 'adb.ap-northeast-1.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('adb', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AllocateClusterPublicConnectionRequest {
  connectionStringPrefix?: string(name='ConnectionStringPrefix', description='The prefix of the public endpoint.

*   The prefix must contain lowercase letters, digits, and hyphens (-). It must start with a lowercase letter.
*   The prefix can be up to 30 characters in length.
*   By default, the cluster name is used as the prefix of the public endpoint.', example='am-bp278jg9****.ads.aliyuncs.com'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the cluster IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a specific region.

This parameter is required.', example='am-bp278jg9****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model AllocateClusterPublicConnectionResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model AllocateClusterPublicConnectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AllocateClusterPublicConnectionResponseBody(name='body'),
}

/**
 * @summary 申请公网链接
 *
 * @param request AllocateClusterPublicConnectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AllocateClusterPublicConnectionResponse
 */
async function allocateClusterPublicConnectionWithOptions(request: AllocateClusterPublicConnectionRequest, runtime: Util.RuntimeOptions): AllocateClusterPublicConnectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.connectionStringPrefix)) {
    query['ConnectionStringPrefix'] = request.connectionStringPrefix;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AllocateClusterPublicConnection',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 申请公网链接
 *
 * @param request AllocateClusterPublicConnectionRequest
 * @return AllocateClusterPublicConnectionResponse
 */
async function allocateClusterPublicConnection(request: AllocateClusterPublicConnectionRequest): AllocateClusterPublicConnectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return allocateClusterPublicConnectionWithOptions(request, runtime);
}

model ApplyAdviceByIdRequest {
  adviceDate?: long(name='AdviceDate', description='The date when the suggestion is generated. Specify the date in the yyyyMMdd format. The date must be in UTC.', example='20221101'),
  adviceId?: string(name='AdviceId', description='The suggestion ID.', example='0baf1f52-53df-487f-8292-99a03716****'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a region.

This parameter is required.', example='am-uf6g8w25jacm7****'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
}

model ApplyAdviceByIdResponseBody = {
  message?: string(name='Message', description='The message returned for the operation. Valid values:

*   **SUCCESS** is returned if the operation is successful.
*   An error message is returned if the operation fails.', example='SUCCESS'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='5DC10091-348D-12B1-906D-AB49D658012E'),
}

model ApplyAdviceByIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ApplyAdviceByIdResponseBody(name='body'),
}

/**
 * @summary ApplyAdviceById
 *
 * @param request ApplyAdviceByIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ApplyAdviceByIdResponse
 */
async function applyAdviceByIdWithOptions(request: ApplyAdviceByIdRequest, runtime: Util.RuntimeOptions): ApplyAdviceByIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.adviceDate)) {
    query['AdviceDate'] = request.adviceDate;
  }
  if (!Util.isUnset(request.adviceId)) {
    query['AdviceId'] = request.adviceId;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ApplyAdviceById',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary ApplyAdviceById
 *
 * @param request ApplyAdviceByIdRequest
 * @return ApplyAdviceByIdResponse
 */
async function applyAdviceById(request: ApplyAdviceByIdRequest): ApplyAdviceByIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return applyAdviceByIdWithOptions(request, runtime);
}

model AttachUserENIRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query cluster IDs.

This parameter is required.', example='am-bp11q28kvl688****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model AttachUserENIResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model AttachUserENIResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AttachUserENIResponseBody(name='body'),
}

/**
 * @summary 打通用户ENI
 *
 * @description You can call this operation only for AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters in elastic mode for Cluster Edition.
 *
 * @param request AttachUserENIRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AttachUserENIResponse
 */
async function attachUserENIWithOptions(request: AttachUserENIRequest, runtime: Util.RuntimeOptions): AttachUserENIResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AttachUserENI',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 打通用户ENI
 *
 * @description You can call this operation only for AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters in elastic mode for Cluster Edition.
 *
 * @param request AttachUserENIRequest
 * @return AttachUserENIResponse
 */
async function attachUserENI(request: AttachUserENIRequest): AttachUserENIResponse {
  var runtime = new Util.RuntimeOptions{};
  return attachUserENIWithOptions(request, runtime);
}

model BatchApplyAdviceByIdListRequest {
  adviceDate?: long(name='AdviceDate', description='The date when the suggestion is generated. Specify the date in the yyyyMMdd format. The date must be in UTC.', example='20221115'),
  adviceIdList?: string(name='AdviceIdList', description='The IDs of the suggestions to be applied. Separate multiple IDs with commas (,).', example='c2589ff3-e86c-4f19-80c8-2aeb7dd9****,53414470-ebf4-4a53-a312-8a1ad8fd****,6e8dce84-fec8-4b0b-9c04-b0cea12c****,b3b9703d-55ca-47e0-96dd-6a4a9dbf****'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a region.

This parameter is required.', example='am-uf6g8w25jacm7****'),
  regionId?: string(name='RegionId', description='The region ID of the cluster. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
}

model BatchApplyAdviceByIdListResponseBody = {
  message?: string(name='Message', description='The message returned for the operation. Valid values:

*   **SUCCESS** is returned if the operation is successful.
*   An error message is returned if the operation fails.', example='SUCCESS'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='86F92D26-B774-5FA1-8E53-82CBEEEBB012'),
}

model BatchApplyAdviceByIdListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchApplyAdviceByIdListResponseBody(name='body'),
}

/**
 * @summary BatchApplyAdviceByIdList
 *
 * @param request BatchApplyAdviceByIdListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchApplyAdviceByIdListResponse
 */
async function batchApplyAdviceByIdListWithOptions(request: BatchApplyAdviceByIdListRequest, runtime: Util.RuntimeOptions): BatchApplyAdviceByIdListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.adviceDate)) {
    query['AdviceDate'] = request.adviceDate;
  }
  if (!Util.isUnset(request.adviceIdList)) {
    query['AdviceIdList'] = request.adviceIdList;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BatchApplyAdviceByIdList',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary BatchApplyAdviceByIdList
 *
 * @param request BatchApplyAdviceByIdListRequest
 * @return BatchApplyAdviceByIdListResponse
 */
async function batchApplyAdviceByIdList(request: BatchApplyAdviceByIdListRequest): BatchApplyAdviceByIdListResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchApplyAdviceByIdListWithOptions(request, runtime);
}

model BindDBResourceGroupWithUserRequest {
  clientToken?: string(name='ClientToken'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the cluster IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a specific region.

This parameter is required.', example='am-bp1ub9grke1****'),
  groupName?: string(name='GroupName', description='The name of the resource group.

This parameter is required.', example='test'),
  groupUser?: string(name='GroupUser', description='The database account with which to associate the resource group. It can be a standard account or a privileged account.

This parameter is required.', example='accout'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model BindDBResourceGroupWithUserResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model BindDBResourceGroupWithUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindDBResourceGroupWithUserResponseBody(name='body'),
}

/**
 * @summary Associates a resource group of an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster with a database account.
 *
 * @description ## Precautions
 * *   This operation is applicable only for elastic clusters of 32 cores or more.
 * *   The default resource group USER_DEFAULT cannot be associated with a database account.
 *
 * @param request BindDBResourceGroupWithUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BindDBResourceGroupWithUserResponse
 */
async function bindDBResourceGroupWithUserWithOptions(request: BindDBResourceGroupWithUserRequest, runtime: Util.RuntimeOptions): BindDBResourceGroupWithUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.groupUser)) {
    query['GroupUser'] = request.groupUser;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindDBResourceGroupWithUser',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Associates a resource group of an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster with a database account.
 *
 * @description ## Precautions
 * *   This operation is applicable only for elastic clusters of 32 cores or more.
 * *   The default resource group USER_DEFAULT cannot be associated with a database account.
 *
 * @param request BindDBResourceGroupWithUserRequest
 * @return BindDBResourceGroupWithUserResponse
 */
async function bindDBResourceGroupWithUser(request: BindDBResourceGroupWithUserRequest): BindDBResourceGroupWithUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindDBResourceGroupWithUserWithOptions(request, runtime);
}

model BindDBResourcePoolWithUserRequest {
  clientToken?: string(name='ClientToken'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the cluster IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a specific region.

This parameter is required.', example='am-bp1ub9grke1****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  poolName?: string(name='PoolName', description='The name of the resource group.

This parameter is required.', example='test'),
  poolUser?: string(name='PoolUser', description='The database account with which to associate the resource group. It can be a standard account or a privileged account.

This parameter is required.', example='accout'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model BindDBResourcePoolWithUserResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model BindDBResourcePoolWithUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BindDBResourcePoolWithUserResponseBody(name='body'),
}

/**
 * @summary 绑定资源组用户
 *
 * @description *   This operation is available only for AnalyticDB for MySQL clusters in elastic mode for Cluster Edition that have 32 cores or more.
 * *   The default resource group USER_DEFAULT cannot be associated with a database account.
 *
 * @param request BindDBResourcePoolWithUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BindDBResourcePoolWithUserResponse
 */
async function bindDBResourcePoolWithUserWithOptions(request: BindDBResourcePoolWithUserRequest, runtime: Util.RuntimeOptions): BindDBResourcePoolWithUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.poolName)) {
    query['PoolName'] = request.poolName;
  }
  if (!Util.isUnset(request.poolUser)) {
    query['PoolUser'] = request.poolUser;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindDBResourcePoolWithUser',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 绑定资源组用户
 *
 * @description *   This operation is available only for AnalyticDB for MySQL clusters in elastic mode for Cluster Edition that have 32 cores or more.
 * *   The default resource group USER_DEFAULT cannot be associated with a database account.
 *
 * @param request BindDBResourcePoolWithUserRequest
 * @return BindDBResourcePoolWithUserResponse
 */
async function bindDBResourcePoolWithUser(request: BindDBResourcePoolWithUserRequest): BindDBResourcePoolWithUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindDBResourcePoolWithUserWithOptions(request, runtime);
}

model CancelActiveOperationTasksRequest {
  ids?: string(name='Ids', description='The cluster ID.', example='am-xxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-beijing'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model CancelActiveOperationTasksResponseBody = {
  ids?: string(name='Ids', description='The cluster ID.', example='am-xxxxxxxx'),
  requestId?: string(name='RequestId', description='The request ID.', example='642F3512-C628-5D0C-8815-F6670CEA00D4'),
}

model CancelActiveOperationTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelActiveOperationTasksResponseBody(name='body'),
}

/**
 * @summary Cancels O\\&M events.
 *
 * @param request CancelActiveOperationTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelActiveOperationTasksResponse
 */
async function cancelActiveOperationTasksWithOptions(request: CancelActiveOperationTasksRequest, runtime: Util.RuntimeOptions): CancelActiveOperationTasksResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ids)) {
    query['Ids'] = request.ids;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CancelActiveOperationTasks',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Cancels O\\&M events.
 *
 * @param request CancelActiveOperationTasksRequest
 * @return CancelActiveOperationTasksResponse
 */
async function cancelActiveOperationTasks(request: CancelActiveOperationTasksRequest): CancelActiveOperationTasksResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelActiveOperationTasksWithOptions(request, runtime);
}

model CheckServiceLinkedRoleRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.', example='cn-beijing'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  serviceName?: string(name='ServiceName', description='The name of the service.', example='ads.aliyuncs.com'),
}

model CheckServiceLinkedRoleResponseBody = {
  hasServiceLinkedRole?: boolean(name='HasServiceLinkedRole', description='Indicates whether an SLR is created.', example='true'),
  requestId?: string(name='RequestId', description='The request ID.', example='BA0F6761-7A8C-59F8-9624-FB56788C0EDF'),
}

model CheckServiceLinkedRoleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckServiceLinkedRoleResponseBody(name='body'),
}

/**
 * @summary Checks whether a service-linked role is created.
 *
 * @param request CheckServiceLinkedRoleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckServiceLinkedRoleResponse
 */
async function checkServiceLinkedRoleWithOptions(request: CheckServiceLinkedRoleRequest, runtime: Util.RuntimeOptions): CheckServiceLinkedRoleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.serviceName)) {
    query['ServiceName'] = request.serviceName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckServiceLinkedRole',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Checks whether a service-linked role is created.
 *
 * @param request CheckServiceLinkedRoleRequest
 * @return CheckServiceLinkedRoleResponse
 */
async function checkServiceLinkedRole(request: CheckServiceLinkedRoleRequest): CheckServiceLinkedRoleResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkServiceLinkedRoleWithOptions(request, runtime);
}

model CreateAccountRequest {
  accountDescription?: string(name='AccountDescription', description='The description of the database account.

*   The description cannot start with `http://` or `https://`.
*   The description can be up to 256 characters in length.', example='Test account'),
  accountName?: string(name='AccountName', description='The name of the database account.

*   The name must start with a lowercase letter and end with a lowercase letter or a digit.
*   The name can contain lowercase letters, digits, and underscores (_).
*   The name must be 2 to 16 characters in length.
*   Reserved account names such as root, admin, and opsadmin cannot be used.

This parameter is required.', example='test_accout'),
  accountPassword?: string(name='AccountPassword', description='The password of the database account.

*   The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
*   Special characters include `! @ # $ % ^ & * ( ) _ + - =`
*   The password must be 8 to 32 characters in length.

This parameter is required.', example='Test_accout1'),
  accountType?: string(name='AccountType', description='The type of the database account. Valid values:

*   **Normal**: standard account. Up to 256 standard accounts can be created for a cluster.
*   **Super** (default): privileged account. Only a single privileged account can be created for a cluster.

>  If a cluster does not have accounts, you can specify this parameter to create a privileged account or standard account. If a cluster has a privileged account, you must set this parameter to Normal to create a standard account. Otherwise, the operation fails. After an account is created, the privileged account has permissions on all databases of the cluster. The standard account does not have permissions and must be granted permissions on specific databases by the privileged account. For more information, see GRANT.', example='Normal'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to view cluster IDs.

This parameter is required.', example='am-bp1r053byu48p****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
}

model CreateAccountShrinkRequest {
  accountDescription?: string(name='AccountDescription', description='The description of the database account.

*   The description cannot start with `http://` or `https://`.
*   The description can be up to 256 characters in length.', example='Test account'),
  accountName?: string(name='AccountName', description='The name of the database account.

*   The name must start with a lowercase letter and end with a lowercase letter or a digit.
*   The name can contain lowercase letters, digits, and underscores (_).
*   The name must be 2 to 16 characters in length.
*   Reserved account names such as root, admin, and opsadmin cannot be used.

This parameter is required.', example='test_accout'),
  accountPassword?: string(name='AccountPassword', description='The password of the database account.

*   The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
*   Special characters include `! @ # $ % ^ & * ( ) _ + - =`
*   The password must be 8 to 32 characters in length.

This parameter is required.', example='Test_accout1'),
  accountType?: string(name='AccountType', description='The type of the database account. Valid values:

*   **Normal**: standard account. Up to 256 standard accounts can be created for a cluster.
*   **Super** (default): privileged account. Only a single privileged account can be created for a cluster.

>  If a cluster does not have accounts, you can specify this parameter to create a privileged account or standard account. If a cluster has a privileged account, you must set this parameter to Normal to create a standard account. Otherwise, the operation fails. After an account is created, the privileged account has permissions on all databases of the cluster. The standard account does not have permissions and must be granted permissions on specific databases by the privileged account. For more information, see GRANT.', example='Normal'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to view cluster IDs.

This parameter is required.', example='am-bp1r053byu48p****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tagShrink?: string(name='Tag'),
}

model CreateAccountResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.', example='am-bp1r053byu48p****'),
  requestId?: string(name='RequestId', description='The request ID.', example='2FED790E-FB61-4721-8C1C-07C627FA5A19'),
  taskId?: int32(name='TaskId', description='The task ID.', example='1564657730'),
}

model CreateAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAccountResponseBody(name='body'),
}

/**
 * @summary Creates a database account for an AnalyticDB for MySQL cluster.
 *
 * @param tmpReq CreateAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAccountResponse
 */
async function createAccountWithOptions(tmpReq: CreateAccountRequest, runtime: Util.RuntimeOptions): CreateAccountResponse {
  Util.validateModel(tmpReq);
  var request = new CreateAccountShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.accountDescription)) {
    query['AccountDescription'] = request.accountDescription;
  }
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.accountPassword)) {
    query['AccountPassword'] = request.accountPassword;
  }
  if (!Util.isUnset(request.accountType)) {
    query['AccountType'] = request.accountType;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAccount',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a database account for an AnalyticDB for MySQL cluster.
 *
 * @param request CreateAccountRequest
 * @return CreateAccountResponse
 */
async function createAccount(request: CreateAccountRequest): CreateAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAccountWithOptions(request, runtime);
}

model CreateDBClusterRequest {
  backupSetID?: string(name='BackupSetID', description='A reserved parameter.', example='N/A'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that it is unique among different requests. The value is case-sensitive and can contain a maximum of 64 ASCII characters in length.', example='123e4567-e89b-12d3-a456-t7241****'),
  computeResource?: string(name='ComputeResource', description='The computing resources of the cluster. You can use computing resources to compute data. The increase in the computing resources can accelerate data queries. The computing resources are available for Cluster Edition and Basic Edition.

*   Computing resources for Cluster Edition include 16 cores and 64 GB memory, 24 cores and 96 GB memory, and 32 cores or more. Cluster Edition supports resource isolation, scheduled scaling, and tiered storage of hot and cold data.
*   Computing resources for Basic Edition include 8 cores and 32 GB memory and 16 cores and 64 GB memory. Alibaba Cloud does not provide an SLA guarantee for Basic Edition, and 4 to 8 hours are required for a failover. We recommend that you do not use Basic Edition in production environments.

> 

*   You can call the [DescribeAvailableResource](https://help.aliyun.com/document_detail/190632.html) operation to query the available computing resources in a region.

*   This parameter must be specified when Mode is set to **Flexible**.', example='32Core128GB'),
  DBClusterCategory?: string(name='DBClusterCategory', description='The edition of the cluster. Valid values:

*   **Cluster**: reserved mode for Cluster Edition

<!---->

*   **MixedStorage**: elastic mode for Cluster Edition

>  If the DBClusterCategory parameter is set to Cluster, you must set the Mode parameter to Reserver. If the DBClusterCategory parameter is set to MixedStorage, you must set the Mode parameter to Flexible. Otherwise, the cluster fails to be created.

This parameter is required.', example='Cluster'),
  DBClusterClass?: string(name='DBClusterClass', description='The specification of the cluster. Valid values:

*   **C8**
*   **C32**

>  This parameter is required if the Mode parameter is set to Reserver.', example='C8'),
  DBClusterDescription?: string(name='DBClusterDescription', description='The description of the cluster.

*   The description cannot start with `http://` or `https`.
*   The description must be 2 to 256 characters in length.', example='test'),
  DBClusterNetworkType?: string(name='DBClusterNetworkType', description='The network type of the cluster. Set the value to **VPC**.

This parameter is required.', example='VPC'),
  DBClusterVersion?: string(name='DBClusterVersion', description='The version of the cluster. Set the value to **3.0**.

This parameter is required.', example='3.0'),
  DBNodeGroupCount?: string(name='DBNodeGroupCount', description='The number of node groups. Valid values: 1 to 200 (integer).

>  This parameter is required if the Mode parameter is set to Reserver.', example='2'),
  DBNodeStorage?: string(name='DBNodeStorage', description='The storage capacity of the cluster. Unit: GB.

*   Valid values when DBClusterClass is set to C8: 100 to 1000
*   Valid values when DBClusterClass is set to C32: 100 to 8000

> * This parameter is required if the Mode parameter is set to Reserver.
> * 1000 The storage capacity less than 1,000 GB increases in 100 GB increments. The storage capacity greater than 1,000 GB increases in 1,000 GB increments.', example='200'),
  diskEncryption?: boolean(name='DiskEncryption', description='Indicates whether disk encryption is enabled. Valid values:

*   true
*   false', example='true'),
  elasticIOResource?: string(name='ElasticIOResource', description='The number of elastic I/O units (EIUs). For more information, see [Elasticity of the storage layer](https://help.aliyun.com/document_detail/189505.html).', example='0'),
  enableSSL?: boolean(name='EnableSSL', description='Specifies whether to enable SSL encryption. Valid values:

*   **true**
*   **false**', example='true'),
  executorCount?: string(name='ExecutorCount', description='A reserved parameter.', example='N/A'),
  kmsId?: string(name='KmsId', description='The Key Management Service (KMS) ID that is used for disk encryption. This parameter takes effect only when DiskEncryption is set to true.', example='xxxxxxxx-xxxx-xxxx-xxxx-xxxx'),
  mode?: string(name='Mode', description='The mode of the cluster. Valid values:

*   **Reserver**: the reserved mode.
*   **Flexible**: the elastic mode.', example='Reserver'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  payType?: string(name='PayType', description='The billing method of the cluster. Valid values:

*   **Postpaid**: pay-as-you-go
*   **Prepaid**: subscription

This parameter is required.', example='Postpaid'),
  period?: string(name='Period', description='The subscription type of the subscription cluster. Valid values:

*   **Year**: subscription on a yearly basis
*   **Month**: subscription on a monthly basis

>  This parameter is required if the PayType parameter is set to Prepaid.', example='Year'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the cluster belongs.', example='rg-4690g37929****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  restoreTime?: string(name='RestoreTime', description='A reserved parameter.', example='N/A'),
  restoreType?: string(name='RestoreType', description='A reserved parameter.', example='N/A'),
  sourceDBInstanceName?: string(name='SourceDBInstanceName', description='A reserved parameter.', example='N/A'),
  storageResource?: string(name='StorageResource', description='A reserved parameter.', example='N/A'),
  storageType?: string(name='StorageType', description='A reserved parameter.', example='N/A'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of tag N to add to the cluster. You can use tags to filter clusters. Valid values of N: 1 to 20. The values that you specify for N must be unique and consecutive integers that start from 1. Each value of `Tag.N.Key` is paired with a value of `Tag.N.Value`.

>  The tag key can be up to 64 characters in length and cannot start with `aliyun`, `acs:`, `http://`, or `https://`.', example='tag1'),
      value?: string(name='Value', description='The value of tag N to add to the cluster. You can use tags to filter clusters. Valid values of N: 1 to 20. The values that you specify for N must be unique and consecutive integers that start from 1. Each value of `Tag.N.Key` is paired with a value of `Tag.N.Value`.

>  The tag value can be up to 64 characters in length and cannot start with `aliyun`, `acs:`, `http://`, or `https://`.', example='test1'),
    }
  ](name='Tag', description='The tags to add to the cluster.'),
  usedTime?: string(name='UsedTime', description='The subscription period of the subscription cluster.

*   Valid values when Period is set to Year: 1, 2, and 3 (integer)
*   Valid values when Period is set to Month: 1 to 9 (integer)

> * This parameter is required if the PayType parameter is set to Prepaid.
> * Longer subscription periods offer more savings. Purchasing a cluster for one year is more cost-effective than purchasing the cluster for 10 or 11 months.', example='1'),
  VPCId?: string(name='VPCId', description='The virtual private cloud (VPC) ID of the cluster.', example='vpc-bp1at5ze0t5u3xtqn****'),
  vSwitchId?: string(name='VSwitchId', description='The vSwitch ID of the cluster.', example='vsw-bp1aadw9k19x6cis9****'),
  zoneId?: string(name='ZoneId', description='The zone ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent zone list.', example='cn-hangzhou-h'),
}

model CreateDBClusterResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.', example='am-bp1r053byu48p****'),
  orderId?: string(name='OrderId', description='The ID of the order.', example='202353278****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the cluster belongs.', example='rg-4690g37929****'),
}

model CreateDBClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDBClusterResponseBody(name='body'),
}

/**
 * @summary Creates an AnalyticDB for MySQL Data Warehouse Edition cluster.
 *
 * @description After you create a cluster, you are billed for the cluster specifications that you select. For more information about the billable items and pricing for Data Warehouse Edition  clusters, see [Billable items of Data Warehouse Edition](https://help.aliyun.com/document_detail/303131.html) and [Pricing for Data Warehouse Edition](https://help.aliyun.com/document_detail/135229.html).
 *
 * @param request CreateDBClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDBClusterResponse
 */
async function createDBClusterWithOptions(request: CreateDBClusterRequest, runtime: Util.RuntimeOptions): CreateDBClusterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.backupSetID)) {
    query['BackupSetID'] = request.backupSetID;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.computeResource)) {
    query['ComputeResource'] = request.computeResource;
  }
  if (!Util.isUnset(request.DBClusterCategory)) {
    query['DBClusterCategory'] = request.DBClusterCategory;
  }
  if (!Util.isUnset(request.DBClusterClass)) {
    query['DBClusterClass'] = request.DBClusterClass;
  }
  if (!Util.isUnset(request.DBClusterDescription)) {
    query['DBClusterDescription'] = request.DBClusterDescription;
  }
  if (!Util.isUnset(request.DBClusterNetworkType)) {
    query['DBClusterNetworkType'] = request.DBClusterNetworkType;
  }
  if (!Util.isUnset(request.DBClusterVersion)) {
    query['DBClusterVersion'] = request.DBClusterVersion;
  }
  if (!Util.isUnset(request.DBNodeGroupCount)) {
    query['DBNodeGroupCount'] = request.DBNodeGroupCount;
  }
  if (!Util.isUnset(request.DBNodeStorage)) {
    query['DBNodeStorage'] = request.DBNodeStorage;
  }
  if (!Util.isUnset(request.diskEncryption)) {
    query['DiskEncryption'] = request.diskEncryption;
  }
  if (!Util.isUnset(request.elasticIOResource)) {
    query['ElasticIOResource'] = request.elasticIOResource;
  }
  if (!Util.isUnset(request.enableSSL)) {
    query['EnableSSL'] = request.enableSSL;
  }
  if (!Util.isUnset(request.executorCount)) {
    query['ExecutorCount'] = request.executorCount;
  }
  if (!Util.isUnset(request.kmsId)) {
    query['KmsId'] = request.kmsId;
  }
  if (!Util.isUnset(request.mode)) {
    query['Mode'] = request.mode;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.payType)) {
    query['PayType'] = request.payType;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.restoreTime)) {
    query['RestoreTime'] = request.restoreTime;
  }
  if (!Util.isUnset(request.restoreType)) {
    query['RestoreType'] = request.restoreType;
  }
  if (!Util.isUnset(request.sourceDBInstanceName)) {
    query['SourceDBInstanceName'] = request.sourceDBInstanceName;
  }
  if (!Util.isUnset(request.storageResource)) {
    query['StorageResource'] = request.storageResource;
  }
  if (!Util.isUnset(request.storageType)) {
    query['StorageType'] = request.storageType;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!Util.isUnset(request.usedTime)) {
    query['UsedTime'] = request.usedTime;
  }
  if (!Util.isUnset(request.VPCId)) {
    query['VPCId'] = request.VPCId;
  }
  if (!Util.isUnset(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDBCluster',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an AnalyticDB for MySQL Data Warehouse Edition cluster.
 *
 * @description After you create a cluster, you are billed for the cluster specifications that you select. For more information about the billable items and pricing for Data Warehouse Edition  clusters, see [Billable items of Data Warehouse Edition](https://help.aliyun.com/document_detail/303131.html) and [Pricing for Data Warehouse Edition](https://help.aliyun.com/document_detail/135229.html).
 *
 * @param request CreateDBClusterRequest
 * @return CreateDBClusterResponse
 */
async function createDBCluster(request: CreateDBClusterRequest): CreateDBClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDBClusterWithOptions(request, runtime);
}

model CreateDBResourceGroupRequest {
  clientToken?: string(name='ClientToken'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the cluster IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a specific region.

This parameter is required.', example='am-bp1ub9grke1****'),
  groupName?: string(name='GroupName', description='The name of the resource group.

*   The name can be up to 255 characters in length.
*   The name must start with an uppercase letter or a digit.
*   The name can contain uppercase letters, digits, hyphens (-), and underscores (_).

This parameter is required.', example='test_group'),
  groupType?: string(name='GroupType', description='The query execution mode. Valid values:

*   **interactive** (default)
*   **batch**', example='interactive'),
  nodeNum?: int32(name='NodeNum', description='The number of nodes. Default value: 0.

*   Each node is configured with the resources of 16 cores and 64 GB memory.
*   Make sure that the amount of resources of the nodes (Number of nodes × 16 cores and 64 GB memory) is less than or equal to the amount of unused resources of the cluster.', example='2'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CreateDBResourceGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='3A8F6106-6AFD-5A34-9C80-8DE2C42D06E8'),
}

model CreateDBResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDBResourceGroupResponseBody(name='body'),
}

/**
 * @summary Creates a resource group for an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.
 *
 * @description ## Precautions
 * This operation is applicable only for elastic clusters of 32 cores or more.
 *
 * @param request CreateDBResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDBResourceGroupResponse
 */
async function createDBResourceGroupWithOptions(request: CreateDBResourceGroupRequest, runtime: Util.RuntimeOptions): CreateDBResourceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.groupType)) {
    query['GroupType'] = request.groupType;
  }
  if (!Util.isUnset(request.nodeNum)) {
    query['NodeNum'] = request.nodeNum;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDBResourceGroup',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a resource group for an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.
 *
 * @description ## Precautions
 * This operation is applicable only for elastic clusters of 32 cores or more.
 *
 * @param request CreateDBResourceGroupRequest
 * @return CreateDBResourceGroupResponse
 */
async function createDBResourceGroup(request: CreateDBResourceGroupRequest): CreateDBResourceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDBResourceGroupWithOptions(request, runtime);
}

model CreateDBResourcePoolRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the cluster IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a specific region.

This parameter is required.', example='am-bp11q28kvl688****'),
  nodeNum?: int32(name='NodeNum', description='The number of nodes. Default value: 0.

*   Each node provides 16 cores and 64 GB memory.
*   The total amount of resources provided by the nodes (number of nodes × 16 cores, number of nodes × 64 GB memory) cannot exceed the total amount of resources in the cluster. Set this parameter to a proper value.', example='2'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  poolName?: string(name='PoolName', description='The name of the resource group.

*   The name can be up to 255 characters in length.
*   The name must start with a letter or a digit.
*   The name can contain letters, digits, hyphens (_), and underscores (_).

This parameter is required.', example='test'),
  queryType?: string(name='QueryType', description='The mode in which to execute SQL statements.

*   **batch**

*   **interactive**

> For more information, see [Query execution modes](https://help.aliyun.com/document_detail/189502.html).', example='interactive'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CreateDBResourcePoolResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model CreateDBResourcePoolResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDBResourcePoolResponseBody(name='body'),
}

/**
 * @summary 创建资源组
 *
 * @description This operation is applicable only for elastic clusters of 32 cores or more.
 *
 * @param request CreateDBResourcePoolRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDBResourcePoolResponse
 */
async function createDBResourcePoolWithOptions(request: CreateDBResourcePoolRequest, runtime: Util.RuntimeOptions): CreateDBResourcePoolResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.nodeNum)) {
    query['NodeNum'] = request.nodeNum;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.poolName)) {
    query['PoolName'] = request.poolName;
  }
  if (!Util.isUnset(request.queryType)) {
    query['QueryType'] = request.queryType;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDBResourcePool',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建资源组
 *
 * @description This operation is applicable only for elastic clusters of 32 cores or more.
 *
 * @param request CreateDBResourcePoolRequest
 * @return CreateDBResourcePoolResponse
 */
async function createDBResourcePool(request: CreateDBResourcePoolRequest): CreateDBResourcePoolResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDBResourcePoolWithOptions(request, runtime);
}

model CreateElasticPlanRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='am-bp1d8lbdj22rx****'),
  elasticPlanEnable?: boolean(name='ElasticPlanEnable', description='Specifies whether the scaling plan takes effect. Valid values:

*   **true** (default)
*   **false**', example='true'),
  elasticPlanEndDay?: string(name='ElasticPlanEndDay', description='The end date of the scaling plan. Specify the date in the yyyy-MM-dd format.', example='2022-12-09'),
  elasticPlanMonthlyRepeat?: string(name='ElasticPlanMonthlyRepeat', description='The dates of the month when you want to execute the scaling plan. A number specifies a date of the month. Separate multiple values with commas (,).', example='1,15,25'),
  elasticPlanName?: string(name='ElasticPlanName', description='The name of the scaling plan.

*   The name must be 2 to 30 characters in length.
*   The name can contain letters, digits, and underscores (_).

This parameter is required.', example='test'),
  elasticPlanNodeNum?: int32(name='ElasticPlanNodeNum', description='The number of nodes that are involved in the scaling plan.

*   If ElasticPlanType is set to **worker**, you can set this parameter to 0 or leave this parameter empty.
*   If ElasticPlanType is set to **executorcombineworker** or **executor**, you must set this parameter to a value that is greater than 0.', example='0', nullable=false),
  elasticPlanStartDay?: string(name='ElasticPlanStartDay', description='The start date of the scaling plan. Specify the date in the yyyy-MM-dd format.', example='2022-12-02'),
  elasticPlanTimeEnd?: string(name='ElasticPlanTimeEnd', description='The restoration time of the scaling plan. Specify the time on the hour in the HH:mm:ss format. The interval between the scale-up time and the restoration time cannot be more than 24 hours.

This parameter is required.', example='10:00:00'),
  elasticPlanTimeStart?: string(name='ElasticPlanTimeStart', description='The scale-up time of the scaling plan. Specify the time on the hour in the HH:mm:ss format.

This parameter is required.', example='08:00:00'),
  elasticPlanType?: string(name='ElasticPlanType', description='The type of the scaling plan. Valid values:

*   **worker**: scales only elastic I/O resources.
*   **executor**: scales only computing resources.
*   **executorcombineworker** (default): scales both elastic I/O resources and computing resources by proportion.
> - If you want to set this parameter to **executorcombineworker**, make sure that the cluster runs a minor version of 3.1.3.2 or later.
> - If you want to set this parameter to **worker** or **executor**, make sure that the cluster runs a minor version of 3.1.6.1 or later and a ticket is submitted. After your request is approved, you can set this parameter to **worker** or **executor**.', example='worker'),
  elasticPlanWeeklyRepeat?: string(name='ElasticPlanWeeklyRepeat', description='The days of the week when you want to execute the scaling plan. Valid values: 0 to 6 (Sunday to Saturday). Separate multiple values with commas (,).', example='1,2,3,4,5'),
  elasticPlanWorkerSpec?: string(name='ElasticPlanWorkerSpec', description='The resource specifications that can be scaled up by the scaling plan. Valid values:

*   8 Core 64 GB (default)
*   16 Core 64 GB
*   32 Core 64 GB
*   64 Core 128 GB
*   12 Core 96 GB
*   24 Core 96 GB
*   52 Core 86 GB', example='32 Core 64 GB'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourcePoolName?: string(name='ResourcePoolName', description='The name of the resource group.

>  You can call the [DescribeDBResourceGroup](https://help.aliyun.com/document_detail/466685.html) operation to query the resource group name.', example='realtime'),
}

model CreateElasticPlanResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model CreateElasticPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateElasticPlanResponseBody(name='body'),
}

/**
 * @summary Creates a scheduled scaling plan. This operation can be used only for AnalyticDB for MySQL clusters in elastic mode for Cluster Edition.
 *
 * @description ###
 * You can call this operation only for AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters in elastic mode for Cluster Edition that have 32 cores or more.
 *
 * @param request CreateElasticPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateElasticPlanResponse
 */
async function createElasticPlanWithOptions(request: CreateElasticPlanRequest, runtime: Util.RuntimeOptions): CreateElasticPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.elasticPlanEnable)) {
    query['ElasticPlanEnable'] = request.elasticPlanEnable;
  }
  if (!Util.isUnset(request.elasticPlanEndDay)) {
    query['ElasticPlanEndDay'] = request.elasticPlanEndDay;
  }
  if (!Util.isUnset(request.elasticPlanMonthlyRepeat)) {
    query['ElasticPlanMonthlyRepeat'] = request.elasticPlanMonthlyRepeat;
  }
  if (!Util.isUnset(request.elasticPlanName)) {
    query['ElasticPlanName'] = request.elasticPlanName;
  }
  if (!Util.isUnset(request.elasticPlanNodeNum)) {
    query['ElasticPlanNodeNum'] = request.elasticPlanNodeNum;
  }
  if (!Util.isUnset(request.elasticPlanStartDay)) {
    query['ElasticPlanStartDay'] = request.elasticPlanStartDay;
  }
  if (!Util.isUnset(request.elasticPlanTimeEnd)) {
    query['ElasticPlanTimeEnd'] = request.elasticPlanTimeEnd;
  }
  if (!Util.isUnset(request.elasticPlanTimeStart)) {
    query['ElasticPlanTimeStart'] = request.elasticPlanTimeStart;
  }
  if (!Util.isUnset(request.elasticPlanType)) {
    query['ElasticPlanType'] = request.elasticPlanType;
  }
  if (!Util.isUnset(request.elasticPlanWeeklyRepeat)) {
    query['ElasticPlanWeeklyRepeat'] = request.elasticPlanWeeklyRepeat;
  }
  if (!Util.isUnset(request.elasticPlanWorkerSpec)) {
    query['ElasticPlanWorkerSpec'] = request.elasticPlanWorkerSpec;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourcePoolName)) {
    query['ResourcePoolName'] = request.resourcePoolName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateElasticPlan',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a scheduled scaling plan. This operation can be used only for AnalyticDB for MySQL clusters in elastic mode for Cluster Edition.
 *
 * @description ###
 * You can call this operation only for AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters in elastic mode for Cluster Edition that have 32 cores or more.
 *
 * @param request CreateElasticPlanRequest
 * @return CreateElasticPlanResponse
 */
async function createElasticPlan(request: CreateElasticPlanRequest): CreateElasticPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return createElasticPlanWithOptions(request, runtime);
}

model CreateServiceLinkedRoleRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-beijing'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  serviceName?: string(name='ServiceName', description='The name of the service.', example='ads.aliyuncs.com'),
}

model CreateServiceLinkedRoleResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='051D7910-3547-5316-AB48-02BE2090B148'),
}

model CreateServiceLinkedRoleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateServiceLinkedRoleResponseBody(name='body'),
}

/**
 * @summary Creates a service-linked role.
 *
 * @param request CreateServiceLinkedRoleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateServiceLinkedRoleResponse
 */
async function createServiceLinkedRoleWithOptions(request: CreateServiceLinkedRoleRequest, runtime: Util.RuntimeOptions): CreateServiceLinkedRoleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.serviceName)) {
    query['ServiceName'] = request.serviceName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateServiceLinkedRole',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a service-linked role.
 *
 * @param request CreateServiceLinkedRoleRequest
 * @return CreateServiceLinkedRoleResponse
 */
async function createServiceLinkedRole(request: CreateServiceLinkedRoleRequest): CreateServiceLinkedRoleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createServiceLinkedRoleWithOptions(request, runtime);
}

model DeleteAccountRequest {
  accountName?: string(name='AccountName', description='The account of the database.

This parameter is required.', example='test_accout'),
  accountType?: string(name='AccountType', description='*   Normal: standard account
*   Super: privileged account', example='Normal'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the cluster.

This parameter is required.', example='rm-uf6wjk5xxxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteAccountResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='2FED790E-FB61-4721-8C1C-07C627FA5A19'),
}

model DeleteAccountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAccountResponseBody(name='body'),
}

/**
 * @summary 删除高权限帐号
 *
 * @param request DeleteAccountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteAccountResponse
 */
async function deleteAccountWithOptions(request: DeleteAccountRequest, runtime: Util.RuntimeOptions): DeleteAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.accountType)) {
    query['AccountType'] = request.accountType;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAccount',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除高权限帐号
 *
 * @param request DeleteAccountRequest
 * @return DeleteAccountResponse
 */
async function deleteAccount(request: DeleteAccountRequest): DeleteAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAccountWithOptions(request, runtime);
}

model DeleteBackupsRequest {
  backupIds?: string(name='BackupIds', description='The ID of the backup set that you want to delete. Separate multiple backup set IDs with commas (,).

This parameter is required.', example='766,767'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL cluster.

This parameter is required.', example='am-bp1ub9grke1****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteBackupsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='771C5FAA-530F-52F7-B84D-EBAD4561D590'),
}

model DeleteBackupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteBackupsResponseBody(name='body'),
}

/**
 * @summary Manually deletes backup sets.
 *
 * @description *   Deleting backup sets is an asynchronous operation and may require 10 to 20 minutes to complete.
 * *   You can delete up to 100 backup sets at a time. If you want to delete more than 100 backup sets, call this operation twice.
 * *   To ensure data security, the system forcibly retains one valid backup set. If you want to delete the last backup set, the system prohibits your operation.
 *
 * @param request DeleteBackupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteBackupsResponse
 */
async function deleteBackupsWithOptions(request: DeleteBackupsRequest, runtime: Util.RuntimeOptions): DeleteBackupsResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteBackups',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Manually deletes backup sets.
 *
 * @description *   Deleting backup sets is an asynchronous operation and may require 10 to 20 minutes to complete.
 * *   You can delete up to 100 backup sets at a time. If you want to delete more than 100 backup sets, call this operation twice.
 * *   To ensure data security, the system forcibly retains one valid backup set. If you want to delete the last backup set, the system prohibits your operation.
 *
 * @param request DeleteBackupsRequest
 * @return DeleteBackupsResponse
 */
async function deleteBackups(request: DeleteBackupsRequest): DeleteBackupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteBackupsWithOptions(request, runtime);
}

model DeleteDBClusterRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

This parameter is required.', example='am-bp1u8c0mgfg58****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteDBClusterResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.', example='am-bp1u8c0mgfg58****'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  taskId?: int32(name='TaskId', description='The task ID.', example='421693038'),
}

model DeleteDBClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDBClusterResponseBody(name='body'),
}

/**
 * @summary Deletes an AnalyticDB for MySQL cluster.
 *
 * @description *   You cannot delete subscription clusters by calling API operations. After expiration, subscription clusters are automatically released. If you no longer need a cluster, you can unsubscribe from the cluster in the Expenses and Costs console. For information about cluster refunds, see [Refund policy](https://help.aliyun.com/document_detail/471477.html).
 * *   After you delete a cluster, resources of the cluster are immediately released, and data of the cluster is no longer retained and cannot be restored. Proceed with caution.
 * *   The cluster that you want to delete must be in the Running state.
 *
 * @param request DeleteDBClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDBClusterResponse
 */
async function deleteDBClusterWithOptions(request: DeleteDBClusterRequest, runtime: Util.RuntimeOptions): DeleteDBClusterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDBCluster',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an AnalyticDB for MySQL cluster.
 *
 * @description *   You cannot delete subscription clusters by calling API operations. After expiration, subscription clusters are automatically released. If you no longer need a cluster, you can unsubscribe from the cluster in the Expenses and Costs console. For information about cluster refunds, see [Refund policy](https://help.aliyun.com/document_detail/471477.html).
 * *   After you delete a cluster, resources of the cluster are immediately released, and data of the cluster is no longer retained and cannot be restored. Proceed with caution.
 * *   The cluster that you want to delete must be in the Running state.
 *
 * @param request DeleteDBClusterRequest
 * @return DeleteDBClusterResponse
 */
async function deleteDBCluster(request: DeleteDBClusterRequest): DeleteDBClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDBClusterWithOptions(request, runtime);
}

model DeleteDBResourceGroupRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='am-bp1ub9grke1****'),
  groupName?: string(name='GroupName', description='The name of the resource group.

This parameter is required.', example='test_group'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteDBResourceGroupResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DeleteDBResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDBResourceGroupResponseBody(name='body'),
}

/**
 * @summary Deletes a resource group from an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.
 *
 * @description ### Precautions
 * *   You can call this operation only for AnalyticDB for MySQL clusters in elastic mode for Cluster Edition that have 32 cores or more.
 * *   The default resource group USER_DEFAULT cannot be deleted.
 *
 * @param request DeleteDBResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDBResourceGroupResponse
 */
async function deleteDBResourceGroupWithOptions(request: DeleteDBResourceGroupRequest, runtime: Util.RuntimeOptions): DeleteDBResourceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDBResourceGroup',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a resource group from an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.
 *
 * @description ### Precautions
 * *   You can call this operation only for AnalyticDB for MySQL clusters in elastic mode for Cluster Edition that have 32 cores or more.
 * *   The default resource group USER_DEFAULT cannot be deleted.
 *
 * @param request DeleteDBResourceGroupRequest
 * @return DeleteDBResourceGroupResponse
 */
async function deleteDBResourceGroup(request: DeleteDBResourceGroupRequest): DeleteDBResourceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDBResourceGroupWithOptions(request, runtime);
}

model DeleteDBResourcePoolRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a specific region.

This parameter is required.', example='am-bp1r053byu48p****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  poolName?: string(name='PoolName', description='The name of the resource group.

This parameter is required.', example='test_group'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteDBResourcePoolResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DeleteDBResourcePoolResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDBResourcePoolResponseBody(name='body'),
}

/**
 * @summary 删除资源组
 *
 * @description **Precautions**
 * *   This operation is available only for AnalyticDB for MySQL clusters in elastic mode for Cluster Edition that have 32 cores or more.
 * *   The default resource group USER_DEFAULT cannot be deleted.
 *
 * @param request DeleteDBResourcePoolRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDBResourcePoolResponse
 */
async function deleteDBResourcePoolWithOptions(request: DeleteDBResourcePoolRequest, runtime: Util.RuntimeOptions): DeleteDBResourcePoolResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.poolName)) {
    query['PoolName'] = request.poolName;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDBResourcePool',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除资源组
 *
 * @description **Precautions**
 * *   This operation is available only for AnalyticDB for MySQL clusters in elastic mode for Cluster Edition that have 32 cores or more.
 * *   The default resource group USER_DEFAULT cannot be deleted.
 *
 * @param request DeleteDBResourcePoolRequest
 * @return DeleteDBResourcePoolResponse
 */
async function deleteDBResourcePool(request: DeleteDBResourcePoolRequest): DeleteDBResourcePoolResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDBResourcePoolWithOptions(request, runtime);
}

model DeleteElasticPlanRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/612241.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a region.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  elasticPlanName?: string(name='ElasticPlanName', description='The name of the scaling plan.

> You can call the [DescribeElasticPlans](https://help.aliyun.com/document_detail/601334.html) operation to query the names of scaling plans.

This parameter is required.', example='test'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteElasticPlanResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DeleteElasticPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteElasticPlanResponseBody(name='body'),
}

/**
 * @summary Deletes a scheduled scaling plan. You can call this operation only for AnalyticDB for MySQL Data Warehouse Edition clusters in elastic mode for Cluster Edition.
 *
 * @param request DeleteElasticPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteElasticPlanResponse
 */
async function deleteElasticPlanWithOptions(request: DeleteElasticPlanRequest, runtime: Util.RuntimeOptions): DeleteElasticPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.elasticPlanName)) {
    query['ElasticPlanName'] = request.elasticPlanName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteElasticPlan',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a scheduled scaling plan. You can call this operation only for AnalyticDB for MySQL Data Warehouse Edition clusters in elastic mode for Cluster Edition.
 *
 * @param request DeleteElasticPlanRequest
 * @return DeleteElasticPlanResponse
 */
async function deleteElasticPlan(request: DeleteElasticPlanRequest): DeleteElasticPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteElasticPlanWithOptions(request, runtime);
}

model DescribeAbnormalPatternDetectionRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-xxxx'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.', example='2021-05-18T06:30Z'),
  lang?: string(name='Lang', description='The language. Valid values:

*   **zh** (default): simplified Chinese.
*   **en**: English.', example='zh'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-shenzhen'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time must be in UTC.', example='2011-06-01T16:00Z'),
}

model DescribeAbnormalPatternDetectionResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-xxxx'),
  detectionItems?: [ 
    {
      message?: string(name='Message', description='The description of the detection result.', example='Two SQL patterns that have abnormal totalTime metric values are detected. This may result in increased CPU utilization, query slowdown, and degraded system stability. Go to the monitoring page to diagnose the issue and then perform optimization.'),
      name?: string(name='Name', description='The name of the detection item.', example='Cost，PeakMemory'),
      results?: [ 
        {
          accessIp?: string(name='AccessIp', description='The IP address of the SQL client that submits the SQL pattern.', example='11.81.238.102'),
          detail?: string(name='Detail', description='The details about the detection report of the SQL pattern.', example='{}'),
          failedCount?: long(name='FailedCount', description='The number of failed SQL patterns within the time range.', example='63'),
          patternId?: string(name='PatternId', description='The SQL pattern ID.', example='5495577090378760322'),
          queryCount?: long(name='QueryCount', description='The number of executed SQL patterns within the time range.', example='72'),
          relatedMetrics?: string(name='RelatedMetrics', description='The metrics related to the SQL pattern.', example='Maximum query duration: 1.43s
Maximum peak memory: 20.73 MB
Maximum read table data: 10.12 MB'),
          SQLPattern?: string(name='SQLPattern', description='The SQL statement that represents the SQL pattern.', example='SELECT *nFROM HIVE.`ADB_EXTERNAL_TPCH_10GB`.`External_customer`nLIMIT ?'),
          tables?: string(name='Tables', description='The names of tables.', example='ad_marketing_engine.prod_dws_oe_promotion_daily_trend_report'),
          user?: string(name='User', description='The name of the database account that is used to submit the query.', example='test'),
        }
      ](name='Results', description='The detection result.'),
      status?: string(name='Status', description='The severity level of the detection result. Valid values:

*   NORMAL
*   WARNING
*   CRITICAL', example='NORMAL
WARNNING
CRITICAL'),
    }
  ](name='DetectionItems', description='The queried detection items and detection results.'),
  requestId?: string(name='RequestId', description='The request ID.', example='36B66482-A215-5F04-A42E-859983D89D7B'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='300'),
}

model DescribeAbnormalPatternDetectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAbnormalPatternDetectionResponseBody(name='body'),
}

/**
 * @summary Queries abnormal SQL patterns within a time range.
 *
 * @param request DescribeAbnormalPatternDetectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAbnormalPatternDetectionResponse
 */
async function describeAbnormalPatternDetectionWithOptions(request: DescribeAbnormalPatternDetectionRequest, runtime: Util.RuntimeOptions): DescribeAbnormalPatternDetectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAbnormalPatternDetection',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries abnormal SQL patterns within a time range.
 *
 * @param request DescribeAbnormalPatternDetectionRequest
 * @return DescribeAbnormalPatternDetectionResponse
 */
async function describeAbnormalPatternDetection(request: DescribeAbnormalPatternDetectionRequest): DescribeAbnormalPatternDetectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAbnormalPatternDetectionWithOptions(request, runtime);
}

model DescribeAccountsRequest {
  accountName?: string(name='AccountName', description='The name of the database account.

>  If you do not specify this parameter, the information about all database accounts is returned.', example='test_accout'),
  accountType?: string(name='AccountType', description='The type of the database account. If you do not specify this parameter, the information about all account types is returned. Valid values:

*   **Normal**: standard account.
*   **Super**: privileged account.', example='Normal'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='rm-uf6wjk5xxxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tags?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tags'),
}

model DescribeAccountsResponseBody = {
  accountList?: {
    DBAccount?: [ 
    {
      accountDescription?: string(name='AccountDescription', description='The description of the database account.', example='C@test'),
      accountName?: string(name='AccountName', description='The name of the database account.', example='test1'),
      accountStatus?: string(name='AccountStatus', description='The state of the database account. Valid values:

*   **Creating**
*   **Available**
*   **Deleting**', example='Available'),
      accountType?: string(name='AccountType', description='The type of the database account. Valid values:

*   **Normal**: standard account.
*   **Super**: privileged account.', example='Normal'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key'),
          value?: string(name='Value'),
        }
      ](name='Tag')
      }(name='Tags'),
    }
  ](name='DBAccount')
  }(name='AccountList', description='The queried database accounts.'),
  requestId?: string(name='RequestId', description='The request ID.', example='64E37E6F-C363-41F3-867A-70EF5DC60EA4'),
}

model DescribeAccountsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAccountsResponseBody(name='body'),
}

/**
 * @summary Queries a list of database accounts for an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeAccountsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAccountsResponse
 */
async function describeAccountsWithOptions(request: DescribeAccountsRequest, runtime: Util.RuntimeOptions): DescribeAccountsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.accountType)) {
    query['AccountType'] = request.accountType;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tags)) {
    query['Tags'] = request.tags;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAccounts',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of database accounts for an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeAccountsRequest
 * @return DescribeAccountsResponse
 */
async function describeAccounts(request: DescribeAccountsRequest): DescribeAccountsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAccountsWithOptions(request, runtime);
}

model DescribeActiveOperationMaintainConfRequest {
  ids?: string(name='Ids', description='The cluster ID.', example='am-xxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-beijing'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmzuemxkbvwqq'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeActiveOperationMaintainConfResponseBody = {
  config?: {
    createdTime?: string(name='CreatedTime', description='The time when the O\\\\&M task was created. The time follows the ISO 8601 standard in the *yyyy-mm-dd*T*hh:mm:ss*Z format. The time is displayed in UTC.', example='2023-06-08T02:23:13Z'),
    cycleTime?: string(name='CycleTime', description='The days on which the O\\\\&M task is executed every week.', example='0'),
    cycleType?: string(name='CycleType', description='The unit of the O\\\\&M task cycle. Valid values:

*   Month
*   Week', example='Month'),
    maintainEndTime?: string(name='MaintainEndTime', description='The end time of the maintenance window.', example='20:00:00Z'),
    maintainStartTime?: string(name='MaintainStartTime', description='The start time of the maintenance window.', example='18:00:00Z'),
    modifiedTime?: string(name='ModifiedTime', description='The time when the O\\\\&M task was modified.', example='2023-05-12T12:34:40Z'),
    status?: int32(name='Status', description='Indicates whether the configuration takes effect. Valid values:

*   1: yes.
*   2: no.', example='2'),
  }(name='Config', description='The queried configuration information.'),
  hasConfig?: int32(name='HasConfig', description='Indicates whether the O\\\\&M task is configured. Valid values:

*   1: yes.
*   0: no.', example='1'),
  requestId?: string(name='RequestId', description='The request ID.', example='92B3D2F0-B5E3-5592-9A6F-D0A6C34ACBA9'),
}

model DescribeActiveOperationMaintainConfResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeActiveOperationMaintainConfResponseBody(name='body'),
}

/**
 * @summary Queries the configuration information about O\\&M tasks.
 *
 * @param request DescribeActiveOperationMaintainConfRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeActiveOperationMaintainConfResponse
 */
async function describeActiveOperationMaintainConfWithOptions(request: DescribeActiveOperationMaintainConfRequest, runtime: Util.RuntimeOptions): DescribeActiveOperationMaintainConfResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ids)) {
    query['Ids'] = request.ids;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeActiveOperationMaintainConf',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the configuration information about O\\&M tasks.
 *
 * @param request DescribeActiveOperationMaintainConfRequest
 * @return DescribeActiveOperationMaintainConfResponse
 */
async function describeActiveOperationMaintainConf(request: DescribeActiveOperationMaintainConfRequest): DescribeActiveOperationMaintainConfResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeActiveOperationMaintainConfWithOptions(request, runtime);
}

model DescribeActiveOperationTasksRequest {
  allowCancel?: int32(name='AllowCancel', description='Specifies whether the O\\\\&M task can be canceled. Valid values:

*   \\\\-1: yes for all O\\\\&M tasks.
*   0: no.
*   1: yes.', example='-1'),
  allowChange?: int32(name='AllowChange', description='Specifies whether the execution time of the O\\\\&M task can be changed. Valid values:

*   \\\\-1: yes for all O\\\\&M tasks.
*   0: no.
*   1: yes.', example='-1'),
  changeLevel?: string(name='ChangeLevel', description='The trigger level of the O\\\\&M task. Default value: all. Valid values:

*   all: all task levels.
*   S0: exception fixing.
*   S1: system O\\\\&M.', example='all'),
  dbType?: string(name='DbType', description='The database type.', example='analyticdb'),
  insName?: string(name='InsName', description='The name of the cluster.', example='am-2ze307ym37t762hnl'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Default value: 25.', example='25'),
  productId?: string(name='ProductId', description='The product ID.', example='ads'),
  region?: string(name='Region', description='The region information.', example='cn-shenzhen'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-shenzhen'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  status?: int32(name='Status', description='The status of the O\\\\&M task. Valid values:

*   \\\\-1: all statuses.
*   3: pending.
*   4: executing.', example='-1'),
  taskType?: string(name='TaskType', description='The type of the O\\\\&M tasks that you want to query. Set the value to all to query all O\\\\&M tasks configured by the Alibaba Cloud account.', example='all'),
}

model DescribeActiveOperationTasksResponseBody = {
  items?: [ 
    {
      allowCancel?: string(name='AllowCancel', description='Indicates whether the O\\\\&M task can be canceled. Valid values:

*   0: no.
*   1: yes.', example='1'),
      allowChange?: string(name='AllowChange', description='Indicates whether the execution time of the O\\\\&M task can be changed. Valid values:

*   0: no.
*   1: yes.', example='0'),
      changeLevel?: string(name='ChangeLevel', description='The trigger level of the O\\\\&M task.', example='all'),
      changeLevelEn?: string(name='ChangeLevelEn', description='The trigger level of the O\\\\&M task.', example='Risk repairment'),
      changeLevelZh?: string(name='ChangeLevelZh', description='The trigger level of the O\\\\&M task in Chinese.', example='System maintenance'),
      createdTime?: string(name='CreatedTime', description='The time when the O\\\\&M task was created.', example='2021-06-15T16:00:00Z'),
      currentAVZ?: string(name='CurrentAVZ', description='The zone ID.', example='cn-beijing-k'),
      dbType?: string(name='DbType', description='The database type.', example='analyticdb'),
      dbVersion?: string(name='DbVersion', description='The database version.', example='3.0'),
      deadline?: string(name='Deadline', description='The end time of the O\\\\&M task.', example='2021-06-15T16:00:00Z'),
      id?: int32(name='Id', description='The O\\\\&M task ID.', example='2389899'),
      impact?: string(name='Impact', description='The impact of the O\\\\&M task.', example='TransientDisconnectionAndMinorVersionUpgrade'),
      impactEn?: string(name='ImpactEn', description='The impact of the O\\\\&M task.', example='Transient instance disconnection, minor version upgrade'),
      impactZh?: string(name='ImpactZh', description='The impact of the O\\\\&M task in Chinese.', example='Service interruption and minor version update'),
      insComment?: string(name='InsComment', description='The description of the O\\\\&M task.', example='xxx'),
      insName?: string(name='InsName', description='The name of the cluster.', example='am-2ze307ym37t762hnl'),
      modifiedTime?: string(name='ModifiedTime', description='The time when the O\\\\&M task was modified.', example='2021-06-15T16:00:00Z'),
      prepareInterval?: string(name='PrepareInterval', description='The preparation time period for the O\\\\&M task.', example='03:00:00'),
      region?: string(name='Region', description='The region ID.', example='cn-hangzhou'),
      resultInfo?: string(name='ResultInfo', description='The response message.', example='xxx'),
      startTime?: string(name='StartTime', description='The start time of the O\\\\&M task.', example='2021-06-15T16:00:00Z'),
      status?: int32(name='Status', description='The status of the O\\\\&M task. Valid values:

*   3: pending.
*   4: executing.', example='3'),
      subInsNames?: [ string ](name='SubInsNames', description='The child instance IDs.'),
      switchTime?: string(name='SwitchTime', description='The time when the switchover was performed.', example='2021-06-15T16:00:00Z'),
      taskParams?: string(name='TaskParams', description='The parameters of the O\\\\&M task.', example='{\\\\"outer_user_params\\\\":{\\\\"TargetMinorVersion\\\\":\\\\"3.2.2.6\\\\",\\\\"detailCode\\\\":\\\\"OldKernelVersionUpgrade\\\\",\\\\"cancelCode\\\\":\\\\"OutOfNewFeatureAndStability\\\\"},\\\\"params\\\\":{},\\\\"internal_params\\\\":{\\\\"instanceInfo\\\\":[],\\\\"destHostInfo\\\\":[]}}'),
      taskType?: string(name='TaskType', description='The type of the O\\\\&M task.', example='rds_apsaradb_upgrade'),
      taskTypeEn?: string(name='TaskTypeEn', description='The type of the O\\\\&M task.', example='Minor version update'),
      taskTypeZh?: string(name='TaskTypeZh', description='The type of the O\\\\&M task in Chinese.', example='Minor version update'),
    }
  ](name='Items', description='The queried O\\\\&M tasks.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='12'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='421794A3-72A5-5D27-9E8B-A75A4C503E17'),
  totalRecordCount?: int32(name='TotalRecordCount', description='The total number of entries returned.', example='20'),
}

model DescribeActiveOperationTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeActiveOperationTasksResponseBody(name='body'),
}

/**
 * @summary Queries the information about O\\&M tasks.
 *
 * @param request DescribeActiveOperationTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeActiveOperationTasksResponse
 */
async function describeActiveOperationTasksWithOptions(request: DescribeActiveOperationTasksRequest, runtime: Util.RuntimeOptions): DescribeActiveOperationTasksResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.allowCancel)) {
    query['AllowCancel'] = request.allowCancel;
  }
  if (!Util.isUnset(request.allowChange)) {
    query['AllowChange'] = request.allowChange;
  }
  if (!Util.isUnset(request.changeLevel)) {
    query['ChangeLevel'] = request.changeLevel;
  }
  if (!Util.isUnset(request.dbType)) {
    query['DbType'] = request.dbType;
  }
  if (!Util.isUnset(request.insName)) {
    query['InsName'] = request.insName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.productId)) {
    query['ProductId'] = request.productId;
  }
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeActiveOperationTasks',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about O\\&M tasks.
 *
 * @param request DescribeActiveOperationTasksRequest
 * @return DescribeActiveOperationTasksResponse
 */
async function describeActiveOperationTasks(request: DescribeActiveOperationTasksRequest): DescribeActiveOperationTasksResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeActiveOperationTasksWithOptions(request, runtime);
}

model DescribeAdviceServiceEnabledRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a region.

This parameter is required.', example='am-2ze0vp0j6t3to****'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeAdviceServiceEnabledResponseBody = {
  message?: string(name='Message', description='The returned message.

*   If the request was successful, **Success** is returned.
*   If the request failed, an error message is returned.', example='[Advisor] Advisor feature is not available for instance: am-2ze0vp0j6t3to****'),
  requestId?: string(name='RequestId', description='The request ID.', example='E031AABF-BD56-5966-A063-4283EF18DB45'),
  result?: boolean(name='Result', description='Indicates whether the suggestion feature is enabled. Valid values:

*   **True**
*   **False**', example='False'),
}

model DescribeAdviceServiceEnabledResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAdviceServiceEnabledResponseBody(name='body'),
}

/**
 * @summary Queries whether the suggestion feature is enabled for an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeAdviceServiceEnabledRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAdviceServiceEnabledResponse
 */
async function describeAdviceServiceEnabledWithOptions(request: DescribeAdviceServiceEnabledRequest, runtime: Util.RuntimeOptions): DescribeAdviceServiceEnabledResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAdviceServiceEnabled',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries whether the suggestion feature is enabled for an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeAdviceServiceEnabledRequest
 * @return DescribeAdviceServiceEnabledResponse
 */
async function describeAdviceServiceEnabled(request: DescribeAdviceServiceEnabledRequest): DescribeAdviceServiceEnabledResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAdviceServiceEnabledWithOptions(request, runtime);
}

model DescribeAllAccountsRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeAllAccountsResponseBody = {
  accountList?: [ 
    {
      user?: string(name='User', description='The name of the database account.', example='rdsdt_dts_adb'),
    }
  ](name='AccountList', description='The queried database accounts.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeAllAccountsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAllAccountsResponseBody(name='body'),
}

/**
 * @summary Queries the information about an account or the list of accounts of a specific database within an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeAllAccountsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAllAccountsResponse
 */
async function describeAllAccountsWithOptions(request: DescribeAllAccountsRequest, runtime: Util.RuntimeOptions): DescribeAllAccountsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAllAccounts',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about an account or the list of accounts of a specific database within an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeAllAccountsRequest
 * @return DescribeAllAccountsResponse
 */
async function describeAllAccounts(request: DescribeAllAccountsRequest): DescribeAllAccountsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAllAccountsWithOptions(request, runtime);
}

model DescribeAllDataSourceRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/612241.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a region.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  schemaName?: string(name='SchemaName', description='The name of the database.

This parameter is required.', example='adb_demo'),
  tableName?: string(name='TableName', description='The name of the table.

This parameter is required.', example='test'),
}

model DescribeAllDataSourceResponseBody = {
  columns?: {
    column?: [ 
    {
      autoIncrementColumn?: boolean(name='AutoIncrementColumn', description='Indicates whether the column is an auto-increment column. Valid values:

*   **true**
*   **false**', example='true'),
      columnName?: string(name='ColumnName', description='The name of the column.', example='id'),
      DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.', example='am-bp1xxxxxxxx47'),
      primaryKey?: boolean(name='PrimaryKey', description='Indicates whether the column is the primary key of the table. Valid values:

*   **true**
*   **false**', example='false'),
      schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
      tableName?: string(name='TableName', description='The name of the table.', example='test'),
      type?: string(name='Type', description='The data type of the column.', example='bigint'),
    }
  ](name='Column')
  }(name='Columns', description='The queried columns.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  schemas?: {
    schema?: [ 
    {
      DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.', example='am-bp1xxxxxxxx47'),
      schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
    }
  ](name='Schema')
  }(name='Schemas', description='The queried databases.'),
  tables?: {
    table?: [ 
    {
      DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.', example='am-bp1xxxxxxxx47'),
      schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
      tableName?: string(name='TableName', description='The name of the table.', example='test'),
    }
  ](name='Table')
  }(name='Tables', description='The queried tables.'),
}

model DescribeAllDataSourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAllDataSourceResponseBody(name='body'),
}

/**
 * @summary Queries a list of databases, tables, and columns in a cluster.
 *
 * @param request DescribeAllDataSourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAllDataSourceResponse
 */
async function describeAllDataSourceWithOptions(request: DescribeAllDataSourceRequest, runtime: Util.RuntimeOptions): DescribeAllDataSourceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.schemaName)) {
    query['SchemaName'] = request.schemaName;
  }
  if (!Util.isUnset(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAllDataSource',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of databases, tables, and columns in a cluster.
 *
 * @param request DescribeAllDataSourceRequest
 * @return DescribeAllDataSourceResponse
 */
async function describeAllDataSource(request: DescribeAllDataSourceRequest): DescribeAllDataSourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAllDataSourceWithOptions(request, runtime);
}

model DescribeAppliedAdvicesRequest {
  adviceType?: string(name='AdviceType', description='The type of the suggestion. Valid values:

*   **INDEX**: index optimization.
*   **TIERING**: hot and cold data optimization.', example='INDEX'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of AnalyticDB for MySQL Data Warehouse Edition clusters within a region.

This parameter is required.', example='am-uf6g8w25jacm7****'),
  endTime?: long(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyyMMdd format. The time must be in UTC.', example='20220824'),
  keyword?: string(name='Keyword', description='The keyword that is used to query information by table name.', example='you_table_name'),
  lang?: string(name='Lang', description='The display language of the suggestion. Valid values:

*   **zh** (default): simplified Chinese.
*   **en**: English.
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  order?: string(name='Order', description='The order by which to sort query results. Specify the parameter value in the JSON format. Example: `[{"Field":"SchemaName","Type":"Asc"}]`.

*   `Field` specifies the field by which to sort the query results. Valid values:

    *   `SchemaName`: the name of the database.
    *   `TableName`: the name of the table.
    *   `JobStatus`: the status of the BUILD job that is triggered on the table.
    *   `SubmitTime`: the time when the suggestion was submitted.
    *   `Benefit`: the expected benefits of the applied optimization suggestion.

*   `Type` specifies the sorting order. Valid values:

    *   `Asc`: ascending order.
    *   `Desc`: descending order.

>  If you do not specify this parameter, optimization suggestions are sorted in descending order based on the submission time.', example='[{"Field":"Benefit","Type":"Desc"}]'),
  pageNumber?: long(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  schemaTableName?: string(name='SchemaTableName', description='The name of the table in the **DatabaseName.TableName** format.', example='tpch.lineitem'),
  startTime?: long(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyyMMdd format. The time must be in UTC.', example='20220811'),
}

model DescribeAppliedAdvicesResponseBody = {
  items?: [ 
    {
      adviceId?: string(name='AdviceId', description='The suggestion ID.', example='7417db9c-914d-43f3-a123-4d0e448f****'),
      benefit?: string(name='Benefit', description='The benefit of the suggestion.', example='0.4 GB of storage saved'),
      buildSQL?: string(name='BuildSQL', description='The SQL statement that is used to execute the BUILD job.', example='build table `schema1`.`table1`'),
      jobStatus?: string(name='JobStatus', description='The state of the suggestion execution job. Valid values:

*   **SUCCEED**
*   **FAILED**', example='SUCCEED'),
      pageNumber?: long(name='PageNumber', description='The page number. Pages start from 1. Default value: 1.', example='1'),
      pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
      rollbackSQL?: string(name='RollbackSQL', description='The SQL statement that is used to roll back the suggestion.', example='alter table `schema1`.`table1` add key col1_1_idx(col1)'),
      SQL?: string(name='SQL', description='The SQL statement that is used to apply the suggestion.', example='alter table `schema1`.`table1` drop key col1_1_idx'),
      schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
      submitStatus?: string(name='SubmitStatus', description='The submission state of the suggestion. Valid values:

*   **SUCCEED**
*   **FAILED**', example='SUCCEED'),
      submitTime?: string(name='SubmitTime', description='The time when the suggestion was submitted. The time follows the ISO 8601 standard in the yyMMddHHmm format. The time is displayed in UTC.', example='2208131600'),
      tableName?: string(name='TableName', description='The name of the table.', example='test'),
      totalCount?: long(name='TotalCount', description='The total number of entries returned. Minimum value: 0. Default value: 0.', example='1'),
    }
  ](name='Items', description='The queried suggestions.'),
  pageNumber?: long(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='84489769-3065-5A28-A4CB-977CD426F1C3'),
  schemaTableNames?: [ string ](name='SchemaTableNames', description='The names of the tables in the DatabaseName.TableName format.'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned. The value is an integer that is greater than or equal to 0. Default value: 0.', example='1'),
}

model DescribeAppliedAdvicesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAppliedAdvicesResponseBody(name='body'),
}

/**
 * @summary Queries the applied optimization suggestions for an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeAppliedAdvicesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAppliedAdvicesResponse
 */
async function describeAppliedAdvicesWithOptions(request: DescribeAppliedAdvicesRequest, runtime: Util.RuntimeOptions): DescribeAppliedAdvicesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.adviceType)) {
    query['AdviceType'] = request.adviceType;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.schemaTableName)) {
    query['SchemaTableName'] = request.schemaTableName;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAppliedAdvices',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the applied optimization suggestions for an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeAppliedAdvicesRequest
 * @return DescribeAppliedAdvicesResponse
 */
async function describeAppliedAdvices(request: DescribeAppliedAdvicesRequest): DescribeAppliedAdvicesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAppliedAdvicesWithOptions(request, runtime);
}

model DescribeAuditLogConfigRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-t4nj8619bz2w3****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeAuditLogConfigResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The details about the access denial. This parameter is returned only if Resource Access Management (RAM) permission verification failed.', example='{
    "PolicyType": "AccountLevelIdentityBasedPolicy",
    "AuthPrincipalOwnerId": "1*****************7",
    "EncodedDiagnosticMessage": "AQIBIAAAAOPdwKY2QLOvgMEc7SkkoJfj1kvZwsaRqNYMh10Tv0wTe0fCzaCdrvgazfNb0EnJKETgXyhR+3BIQjx9WAqZryejBsp1Bl4qI5En/D9dEhcXAtKCxCmE2kZCiEzpy8BoEUt+bs0DmlaGWO5xkEpttypLIB4rUhDvZd+zwPg4EXk4KSSWSWsurxtqDkKEMshKlQFBTKvJcKwyhk62IeYly4hQ+5IpXjkh1GQXuDRCQ==",
    "AuthPrincipalType": "SubUser",
    "AuthPrincipalDisplayName": "2***************9",
    "NoPermissionType": "ImplicitDeny",
    "AuthAction": "adb:DescribeExcessivePrimaryKeys"
}'),
  auditLogStatus?: string(name='AuditLogStatus', description='The status of SQL audit. Valid values:

*   **on**: SQL audit is enabled.
*   **off**: SQL audit is disabled.', example='on'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-t4nj8619bz2w3****'),
  requestId?: string(name='RequestId', description='The request ID.', example='F0983B43-B2EC-536A-8791-142B5CF1E9B6'),
}

model DescribeAuditLogConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAuditLogConfigResponseBody(name='body'),
}

/**
 * @summary Queries the SQL audit settings of an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeAuditLogConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAuditLogConfigResponse
 */
async function describeAuditLogConfigWithOptions(request: DescribeAuditLogConfigRequest, runtime: Util.RuntimeOptions): DescribeAuditLogConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAuditLogConfig',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the SQL audit settings of an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeAuditLogConfigRequest
 * @return DescribeAuditLogConfigResponse
 */
async function describeAuditLogConfig(request: DescribeAuditLogConfigRequest): DescribeAuditLogConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAuditLogConfigWithOptions(request, runtime);
}

model DescribeAuditLogRecordsRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='am-t4nj8619bz2w3****'),
  DBName?: string(name='DBName', description='The name of the database on which you want to execute the SQL statement.', example='adb_demo'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

> - The end time must be later than the start time.
> - The maximum time range that can be specified is 24 hours.', example='2022-01-23T22:18Z'),
  hostAddress?: string(name='HostAddress', description='The IP address and port number of the client that is used to execute the SQL statement.', example='100.104.XX.XX:43908'),
  order?: string(name='Order', description='The order in which specified fields are sorted. Specify this parameter as an ordered JSON array that consists of the Field and Type fields.

*   Field specifies the field that is used to sort the retrieved entries. Valid values:

    *   HostAddress: the IP address of the client that is used to connect to the database.
    *   Succeed: specifies whether the SQL statement is successfully executed.
    *   TotalTime: the total amount of time that is consumed to execute the SQL statement.
    *   DBName: the name of the database on which the SQL statement is executed.
    *   SQLType: the type of the SQL statement.
    *   User: the username that is used to execute the SQL statement.
    *   ExecuteTime: the time to start executing the SQL statement.

*   Type specifies the sorting order. Valid values:

    *   Desc: descending order.
    *   Asc: ascending order.', example='[{"Field":"ExecuteTime","Type":"Desc"},{"Field":"HostAddress","Type":"Asc"}]'),
  orderType?: string(name='OrderType', description='The sorting order of the retrieved entries. Valid values:

*   **asc**: sorts the retrieved entries by time in ascending order.
*   **desc**: sorts the retrieved entries by time in descending order.', example='asc'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. The value is an integer that is greater than 0. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   **10**
*   **30**
*   **50**
*   **100**

>  If you leave this parameter empty, the value 10 is used.', example='10'),
  queryKeyword?: string(name='QueryKeyword', description='The keywords that are included in the SQL statement to query.', example='adb'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sqlType?: string(name='SqlType', description='The type of the SQL statement. Valid values:

*   **DELETE**
*   **SELECT**
*   **UPDATE**
*   **INSERT_INTO_SELECT**
*   **ALTER**
*   **DROP**
*   **CREATE**

> You can query only a single type of SQL statements at a time. If you leave this parameter empty, the **SELECT** statements are queried.', example='SELECT'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

> SQL audit logs can be queried only when SQL audit is enabled. Only SQL audit logs within the last 30 days can be queried. If SQL audit was disabled and re-enabled, only SQL audit logs from the time when SQL audit was re-enabled can be queried.', example='2022-01-23T02:18Z'),
  succeed?: string(name='Succeed', description='Specifies whether the execution of the SQL statement succeeds. Valid values:

*   **true**
*   **false**', example='true'),
  user?: string(name='User', description='The name of the user who executed the SQL statement.', example='test_user'),
}

model DescribeAuditLogRecordsResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-t4nj8619bz2w3****'),
  items?: [ 
    {
      connId?: string(name='ConnId', description='This parameter is unavailable.', example='None'),
      DBName?: string(name='DBName', description='The name of the database on which the SQL statement was executed.', example='adb_test'),
      executeTime?: string(name='ExecuteTime', description='The start time of the execution of the SQL statement. The time is displayed in the ISO 8601 standard in the yyyy-MM-dd HH:mm:ss format. The time must be in UTC.', example='2022-01-23 16:05:08'),
      hostAddress?: string(name='HostAddress', description='The IP address and port number of the client that is used to execute the SQL statement.', example='100.104.XX.XX:43908'),
      processID?: string(name='ProcessID', description='The task ID.', example='202106081752021720161662490345362390'),
      SQLText?: string(name='SQLText', description='Details of the SQL statement.', example='SELECT * FROM tb_courses'),
      SQLType?: string(name='SQLType', description='The type of the SQL statement.', example='SELECT'),
      succeed?: string(name='Succeed', description='Indicates whether the SQL statement was successfully executed. Valid values:

*   **true**
*   **false**', example='true'),
      totalTime?: string(name='TotalTime', description='The amount of time that is consumed to execute the SQL statement. Unit: milliseconds.', example='216'),
      user?: string(name='User', description='The name of the user who executed the SQL statement.', example='test_user'),
    }
  ](name='Items', description='The queried SQL audit logs.'),
  pageNumber?: string(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries returned per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='8A564B7F-8C00-43C0-8EC5-919FBB70573'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model DescribeAuditLogRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAuditLogRecordsResponseBody(name='body'),
}

/**
 * @summary Queries the SQL audit logs of an AnalyticDB for MySQL cluster.
 *
 * @description Before you call the DescribeAuditLogRecords operation to query the SQL audit logs of an AnalyticDB for MySQL cluster, you must enable SQL audit for the cluster. You can call the [DescribeAuditLogConfig](https://help.aliyun.com/document_detail/190628.html) operation to query the status of SQL audit. If SQL audit is disabled, you can call the [ModifyAuditLogConfig](https://help.aliyun.com/document_detail/190629.html) operation to enable SQL audit.
 * SQL audit logs can be queried only when SQL audit is enabled. Only SQL audit logs within the last 30 days can be queried. If SQL audit was disabled and re-enabled, only SQL audit logs from the time when SQL audit was re-enabled can be queried. The following operations are not recorded in SQL audit logs: **INSERT INTO VALUES**, **REPLACE INTO VALUES**, and **UPSERT INTO VALUES**.
 *
 * @param request DescribeAuditLogRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAuditLogRecordsResponse
 */
async function describeAuditLogRecordsWithOptions(request: DescribeAuditLogRecordsRequest, runtime: Util.RuntimeOptions): DescribeAuditLogRecordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.DBName)) {
    query['DBName'] = request.DBName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.hostAddress)) {
    query['HostAddress'] = request.hostAddress;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.orderType)) {
    query['OrderType'] = request.orderType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.queryKeyword)) {
    query['QueryKeyword'] = request.queryKeyword;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sqlType)) {
    query['SqlType'] = request.sqlType;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.succeed)) {
    query['Succeed'] = request.succeed;
  }
  if (!Util.isUnset(request.user)) {
    query['User'] = request.user;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAuditLogRecords',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the SQL audit logs of an AnalyticDB for MySQL cluster.
 *
 * @description Before you call the DescribeAuditLogRecords operation to query the SQL audit logs of an AnalyticDB for MySQL cluster, you must enable SQL audit for the cluster. You can call the [DescribeAuditLogConfig](https://help.aliyun.com/document_detail/190628.html) operation to query the status of SQL audit. If SQL audit is disabled, you can call the [ModifyAuditLogConfig](https://help.aliyun.com/document_detail/190629.html) operation to enable SQL audit.
 * SQL audit logs can be queried only when SQL audit is enabled. Only SQL audit logs within the last 30 days can be queried. If SQL audit was disabled and re-enabled, only SQL audit logs from the time when SQL audit was re-enabled can be queried. The following operations are not recorded in SQL audit logs: **INSERT INTO VALUES**, **REPLACE INTO VALUES**, and **UPSERT INTO VALUES**.
 *
 * @param request DescribeAuditLogRecordsRequest
 * @return DescribeAuditLogRecordsResponse
 */
async function describeAuditLogRecords(request: DescribeAuditLogRecordsRequest): DescribeAuditLogRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAuditLogRecordsWithOptions(request, runtime);
}

model DescribeAutoRenewAttributeRequest {
  DBClusterIds?: string(name='DBClusterIds', description='The cluster ID. Separate multiple clusters with commas (,).

This parameter is required.', example='am-bp11q28kvl688****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   30
*   50
*   100

Default value: 30.', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-4690g37929****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeAutoRenewAttributeResponseBody = {
  items?: {
    autoRenewAttribute?: [ 
    {
      autoRenewEnabled?: boolean(name='AutoRenewEnabled', description='Indicates whether auto-renewal is enabled for the cluster. Valid values:

*   **true**
*   **false**', example='true'),
      DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-bp11q28kvl688****'),
      duration?: int32(name='Duration', description='The renewal duration.', example='1'),
      periodUnit?: string(name='PeriodUnit', description='The unit of the renewal duration. Valid values:

*   **Year**
*   **Month**', example='Year'),
      regionId?: string(name='RegionId', description='The region ID of the cluster.', example='cn-hangzhou'),
      renewalStatus?: string(name='RenewalStatus', description='The renewal status of the cluster. Valid values:

*   **AutoRenewal**: The cluster is automatically renewed.
*   **Normal**: The cluster is manually renewed. Before the cluster expires, the system sends you a reminder by SMS message.
*   **NotRenewal**: The cluster is not renewed. Three days before the cluster expires, the system sends you a reminder by SMS message to remind you that the cluster is not renewed. However, the system does not send you a reminder when the cluster expires.', example='AutoRenewal'),
    }
  ](name='AutoRenewAttribute')
  }(name='Items', description='The renewal information of the cluster.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageRecordCount?: int32(name='PageRecordCount', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  totalRecordCount?: int32(name='TotalRecordCount', description='The total number of entries returned.', example='20'),
}

model DescribeAutoRenewAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAutoRenewAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the auto-renewal status of a subscription AnalyticDB for MySQL cluster.
 *
 * @param request DescribeAutoRenewAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAutoRenewAttributeResponse
 */
async function describeAutoRenewAttributeWithOptions(request: DescribeAutoRenewAttributeRequest, runtime: Util.RuntimeOptions): DescribeAutoRenewAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterIds)) {
    query['DBClusterIds'] = request.DBClusterIds;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAutoRenewAttribute',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the auto-renewal status of a subscription AnalyticDB for MySQL cluster.
 *
 * @param request DescribeAutoRenewAttributeRequest
 * @return DescribeAutoRenewAttributeResponse
 */
async function describeAutoRenewAttribute(request: DescribeAutoRenewAttributeRequest): DescribeAutoRenewAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAutoRenewAttributeWithOptions(request, runtime);
}

model DescribeAvailableAdvicesRequest {
  adviceDate?: long(name='AdviceDate', description='The date when the suggestion is generated. Specify the date in the yyyyMMdd format. The date must be in UTC.

>  Suggestions are generated after analysis after midnight every day. You must specify a date that is at least one day earlier than the current date. For example, if the current date is 20240627, you must specify 20240626 or an earlier date.

This parameter is required.', example='20221124'),
  adviceType?: string(name='AdviceType', description='The type of the suggestion. Valid values:

*   **INDEX**: index optimization.
*   **TIERING**: hot and cold data optimization.', example='Index'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of Data Warehouse Edition (V3.0) clusters.

This parameter is required.', example='am-bp198m028ih55****'),
  keyword?: string(name='Keyword', description='The keyword that is used to query information by table name.', example='you_table_name'),
  lang?: string(name='Lang', description='The display language of the suggestion. Default value: zh. Valid values:

*   **zh**: simplified Chinese
*   **en**: English
*   **ja**: Japanese
*   **zh-tw**: traditional Chinese

This parameter is required.', example='zh'),
  order?: string(name='Order', description='The order by which to sort query results. Specify the parameter value in the JSON format. Example: `[{"Field":"SchemaName","Type":"Asc"}]`.

*   `Field` specifies the field by which to sort the query results. Valid values:

    *   `SchemaName`: the name of the database.
    *   `TableName`: the name of the table.
    *   `Benefit`: the expected benefits of the applied optimization suggestion.

*   `Type` specifies the sorting order. Valid values:

    *   `Asc`: ascending order.
    *   `Desc`: descending order.

>  If you do not specify this parameter, the query results are sorted in descending order based on the Benefit field.', example='[{"Field":"Benefit","Type":"Desc"}]'),
  pageNumber?: long(name='PageNumber', description='The number of the page to return. The value must be an integer that is greater than 0. Default value: 1.

This parameter is required.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries to return on each page. Default value: 30. Valid values:

*   **30**
*   **50**
*   **100**

This parameter is required.', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  schemaTableName?: string(name='SchemaTableName', description='The name of the table in the **DatabaseName.TableName** format.', example='tpch.lineitem'),
}

model DescribeAvailableAdvicesResponseBody = {
  items?: [ 
    {
      adviceDate?: string(name='AdviceDate', description='The time when the suggestion was generated. The time follows the ISO 8601 standard in the yyyyMMdd format. The time is displayed in UTC.', example='20221124'),
      adviceId?: string(name='AdviceId', description='The suggestion ID.', example='dcd04135-0925-4aed-a5a7-e7d92cb1****'),
      adviceType?: string(name='AdviceType', description='The type of the suggestion. Valid values:

*   **Index**: index optimization.
*   **Tiering**: hot and cold data optimization.', example='Index'),
      benefit?: string(name='Benefit', description='The benefit of the suggestion.', example='0.4 GB of storage saved'),
      pageNumber?: long(name='PageNumber', description='The page number. Pages start from 1. Default value: 1.', example='1'),
      pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
      reason?: string(name='Reason', description='The reason why the suggestion was generated.', example='Unused for 15 days, historical usage less than 1%'),
      SQL?: string(name='SQL', description='The SQL statement that is used to apply the suggestion.', example='alter table `schema1`.`table1` drop key col1_1_idx'),
      schemaName?: string(name='SchemaName', description='The name of the schema.', example='adb_demo'),
      tableName?: string(name='TableName', description='The name of the table.', example='test_table'),
      totalCount?: long(name='TotalCount', description='The total number of entries returned. Minimum value: 0. Default value: 0.', example='30'),
    }
  ](name='Items', description='The queried suggestions.'),
  pageNumber?: long(name='PageNumber', description='The page number of the returned page. The value must be an integer that is greater than 0. Default value: 1.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries returned per page. Default value: 30. Valid values:

*   **30**
*   **50**
*   **100**', example='30'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='96A55627-28E9-5E47-B8F6-D786BE551349'),
  schemaTableNames?: [ string ](name='SchemaTableNames', description='The name of the table in the DatabaseName.TableName format.'),
  totalCount?: long(name='TotalCount', description='The total number of entries returned. The value must be an integer that is greater than or equal to 0. Default value: 0.', example='30'),
}

model DescribeAvailableAdvicesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAvailableAdvicesResponseBody(name='body'),
}

/**
 * @summary Queries the available suggestions for cluster optimization.
 *
 * @param request DescribeAvailableAdvicesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAvailableAdvicesResponse
 */
async function describeAvailableAdvicesWithOptions(request: DescribeAvailableAdvicesRequest, runtime: Util.RuntimeOptions): DescribeAvailableAdvicesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.adviceDate)) {
    query['AdviceDate'] = request.adviceDate;
  }
  if (!Util.isUnset(request.adviceType)) {
    query['AdviceType'] = request.adviceType;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.schemaTableName)) {
    query['SchemaTableName'] = request.schemaTableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAvailableAdvices',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the available suggestions for cluster optimization.
 *
 * @param request DescribeAvailableAdvicesRequest
 * @return DescribeAvailableAdvicesResponse
 */
async function describeAvailableAdvices(request: DescribeAvailableAdvicesRequest): DescribeAvailableAdvicesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAvailableAdvicesWithOptions(request, runtime);
}

model DescribeAvailableResourceRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='The language of query results. Valid values:

*   **zh-CN** (default): Chinese.
*   **en-US**: English.', example='zh-CN'),
  chargeType?: string(name='ChargeType', description='The billing method. Valid values:

*   **PrePaid**: subscription.
*   **PostPaid**: pay-as-you-go.', example='PostPaid'),
  DBClusterVersion?: string(name='DBClusterVersion', description='The version of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.', example='3.0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  zoneId?: string(name='ZoneId', description='The zone ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent zone list.', example='cn-hangzhou-k'),
}

model DescribeAvailableResourceResponseBody = {
  availableZoneList?: [ 
    {
      supportedComputeResource?: [ string ](name='SupportedComputeResource', description='A reserved parameter.'),
      supportedMode?: [ 
        {
          mode?: string(name='Mode', description='The supported mode. Valid values:

*   **flexible**: elastic mode.
*   **reserver**: reserved mode.', example='flexible'),
          supportedSerialList?: [ 
            {
              serial?: string(name='Serial', description='The supported edition. Valid values:

*   **basic**: Basic Edition.
*   **cluster**: Cluster Edition.
*   **mixed_storage**: elastic mode for Cluster Edition.', example='mixed_storage'),
              supportedFlexibleResource?: [ 
                {
                  storageType?: string(name='StorageType', description='The disk storage type. Valid values:

*   **hdd**
*   **ssd**', example='hdd'),
                  supportedComputeResource?: [ string ](name='SupportedComputeResource', description='The supported computing resources.'),
                  supportedElasticIOResource?: {
                    maxCount?: string(name='MaxCount', description='The maximum amount of elastic I/O resources.', example='200'),
                    minCount?: string(name='MinCount', description='The minimum amount of elastic I/O resources.', example='0'),
                    step?: string(name='Step', description='The step size.', example='1'),
                  }(name='SupportedElasticIOResource', description='The supported elastic I/O resources.'),
                  supportedStorageResource?: [ string ](name='SupportedStorageResource', description='The supported storage resources.'),
                }
              ](name='SupportedFlexibleResource', description='The supported resources in elastic mode.'),
              supportedInstanceClassList?: [ 
                {
                  instanceClass?: string(name='InstanceClass', description='The supported instance type.', example='C32'),
                  supportedExecutorList?: [ 
                    {
                      nodeCount?: {
                        maxCount?: string(name='MaxCount', description='A reserved parameter.', example='N/A'),
                        minCount?: string(name='MinCount', description='A reserved parameter.', example='N/A'),
                        step?: string(name='Step', description='A reserved parameter.', example='N/A'),
                      }(name='NodeCount', description='The information about the supported compute nodes.'),
                    }
                  ](name='SupportedExecutorList', description='A reserved parameter.'),
                  supportedNodeCountList?: [ 
                    {
                      nodeCount?: {
                        maxCount?: string(name='MaxCount', description='The maximum number of compute nodes.', example='200'),
                        minCount?: string(name='MinCount', description='The minimum number of compute nodes.', example='1'),
                        step?: string(name='Step', description='The step size.', example='1'),
                      }(name='NodeCount', description='The number of the supported compute nodes.'),
                      storageSize?: [ string ](name='StorageSize', description='The support storage capacity. Unit: GB.'),
                    }
                  ](name='SupportedNodeCountList', description='The supported compute nodes.'),
                  tips?: string(name='Tips', description='The description of the instance type.', example='C32'),
                }
              ](name='SupportedInstanceClassList', description='The supported resources in reserved mode.'),
            }
          ](name='SupportedSerialList', description='The supported editions.'),
        }
      ](name='SupportedMode', description='The supported modes.'),
      supportedStorageResource?: [ string ](name='SupportedStorageResource', description='A reserved parameter.'),
      zoneId?: string(name='ZoneId', description='The zone ID.', example='cn-hangzhou-h'),
      zoneName?: string(name='ZoneName', description='The name of the zone.', example='cn-hangzhou-k'),
    }
  ](name='AvailableZoneList', description='The supported zones.'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeAvailableResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAvailableResourceResponseBody(name='body'),
}

/**
 * @summary Queries the resources of clusters within zones of a region.
 *
 * @param request DescribeAvailableResourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAvailableResourceResponse
 */
async function describeAvailableResourceWithOptions(request: DescribeAvailableResourceRequest, runtime: Util.RuntimeOptions): DescribeAvailableResourceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.DBClusterVersion)) {
    query['DBClusterVersion'] = request.DBClusterVersion;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAvailableResource',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the resources of clusters within zones of a region.
 *
 * @param request DescribeAvailableResourceRequest
 * @return DescribeAvailableResourceResponse
 */
async function describeAvailableResource(request: DescribeAvailableResourceRequest): DescribeAvailableResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAvailableResourceWithOptions(request, runtime);
}

model DescribeBackupPolicyRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the cluster.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeBackupPolicyResponseBody = {
  backupRetentionPeriod?: int32(name='BackupRetentionPeriod', description='The number of days for which data backup files are retained.', example='7'),
  enableBackupLog?: string(name='EnableBackupLog', description='Specifies whether to enable the origin protocol policy.

*   true: enabled
*   false: disabled', example='true'),
  logBackupRetentionPeriod?: int32(name='LogBackupRetentionPeriod', description='The number of days for which log backup files are retained.', example='7'),
  preferredBackupPeriod?: string(name='PreferredBackupPeriod', description='The cycle based on which backups are performed. If more than one day of the week is specified, the days of the week are separated by commas (,). Valid values:

*   Monday
*   Tuesday
*   Wednesday
*   Thursday
*   Friday
*   Saturday
*   Sunday', example='Tuesday,Friday'),
  preferredBackupTime?: string(name='PreferredBackupTime', description='The backup time. Specify the time in the HH:mmZ-HH:mmZ format.', example='15:00Z-16:00Z'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeBackupPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupPolicyResponseBody(name='body'),
}

/**
 * @summary 查看备份策略
 *
 * @param request DescribeBackupPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupPolicyResponse
 */
async function describeBackupPolicyWithOptions(request: DescribeBackupPolicyRequest, runtime: Util.RuntimeOptions): DescribeBackupPolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBackupPolicy',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查看备份策略
 *
 * @param request DescribeBackupPolicyRequest
 * @return DescribeBackupPolicyResponse
 */
async function describeBackupPolicy(request: DescribeBackupPolicyRequest): DescribeBackupPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupPolicyWithOptions(request, runtime);
}

model DescribeBackupsRequest {
  backupId?: string(name='BackupId', description='The ID of the backup set.', example='32732****'),
  crossRole?: string(name='CrossRole', description='The Resource Access Management (RAM) role of the Alibaba Cloud account to which the backup set belongs.

>  This parameter must be specified only when cross-account backup operations are performed.', example='role-for-xxx'),
  crossUid?: string(name='CrossUid', description='The Alibaba Cloud account to which the backup set belongs.

>  This parameter must be specified only when cross-account backup operations are performed.', example='195****'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a region.

This parameter is required.', example='am-bp18934i73vb5****'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC. The end time must be later than the start time.', example='2022-06-02T16:00Z'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.', example='2022-06-01T16:00Z'),
}

model DescribeBackupsResponseBody = {
  freeBackupSize?: long(name='FreeBackupSize', description='The free size of backup sets. Unit: bytes.', example='0'),
  items?: {
    backup?: [ 
    {
      backupEndTime?: string(name='BackupEndTime', description='The end time of the backup.', example='2022-06-02T16:00Z'),
      backupExpiredTime?: string(name='BackupExpiredTime', description='The expiration time of the backup set.', example='2022-07-02T16:00Z'),
      backupId?: string(name='BackupId', description='The backup set ID.', example='32732****'),
      backupMethod?: string(name='BackupMethod', description='The backup method. Only Snapshot is returned.', example='Snapshot'),
      backupSize?: long(name='BackupSize', description='The size of the backup set. Unit: bytes.', example='2167808'),
      backupStartTime?: string(name='BackupStartTime', description='The start time of the backup.', example='2022-06-01T16:00Z'),
      backupType?: string(name='BackupType', description='The backup type. Valid values:

*   **FullBackup**
*   **IncrementalBackup**', example='FullBackup'),
      DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.', example='am-bp18934i73vb5****'),
    }
  ](name='Backup')
  }(name='Items', description='The queried backup sets.'),
  pageNumber?: string(name='PageNumber', description='The page number.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  totalBackupSize?: long(name='TotalBackupSize', description='The total size of backup sets. Unit: bytes.', example='64953700'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='300'),
}

model DescribeBackupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBackupsResponseBody(name='body'),
}

/**
 * @summary Queries a list of backup sets for an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeBackupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBackupsResponse
 */
async function describeBackupsWithOptions(request: DescribeBackupsRequest, runtime: Util.RuntimeOptions): DescribeBackupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.backupId)) {
    query['BackupId'] = request.backupId;
  }
  if (!Util.isUnset(request.crossRole)) {
    query['CrossRole'] = request.crossRole;
  }
  if (!Util.isUnset(request.crossUid)) {
    query['CrossUid'] = request.crossUid;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBackups',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of backup sets for an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeBackupsRequest
 * @return DescribeBackupsResponse
 */
async function describeBackups(request: DescribeBackupsRequest): DescribeBackupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupsWithOptions(request, runtime);
}

model DescribeBadSqlDetectionRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/98094.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-xxx'),
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time. Specify the time in the *yyyy-MM-dd*T*HH:mm*Z format. The time must be in UTC.', example='2021-09-30T00:15Z'),
  lang?: string(name='Lang', description='The language. Valid values:

*   **zh (default)**: simplified Chinese.
*   **en**: English.
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/454314.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2021-05-18T06:00:00Z'),
}

model DescribeBadSqlDetectionResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The information about the request denial.', example='{
    "PolicyType": "AccountLevelIdentityBasedPolicy",
    "AuthPrincipalOwnerId": "1*****************7",
    "EncodedDiagnosticMessage": "AQIBIAAAAOPdwKY2QLOvgMEc7SkkoJfj1kvZwsaRqNYMh10Tv0wTe0fCzaCdrvgazfNb0EnJKETgXyhR+3BIQjx9WAqZryejBsp1Bl4qI5En/D9dEhcXAtKCxCmE2kZCiEzpy8BoEUt+bs0DmlaGWO5xkEpttypLIB4rUhDvZd+zwPg4EXk4KSSWSWsurxtqDkKEMshKlQFBTKvJcKwyhk62IeYly4hQ+5IpXjkh1GQXuDRCQ==",
    "AuthPrincipalType": "SubUser",
    "AuthPrincipalDisplayName": "2***************9",
    "NoPermissionType": "ImplicitDeny",
    "AuthAction": "adb:DescribeExcessivePrimaryKeys"
}'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-xxx'),
  detectionItems?: [ 
    {
      message?: string(name='Message', description='The information about the diagnostic result.', example='Multiple bad SQL statements are detected. Perform optimization on the statements.'),
      name?: string(name='Name', description='The name of the detection item.', example='PeakMemory
OperatorCost
ScanSize'),
      results?: [ 
        {
          cost?: long(name='Cost', description='The total execution duration. Unit: milliseconds.

>  This value is the cumulative value of the `QueuedTime`, `TotalPlanningTime`, and `ExecutionTime` parameters.', example='37'),
          diagnosisResults?: [ 
            {
              code?: string(name='Code', description='The diagnostic code.', example='FILTER_NOT_PUSHDOWN'),
              detail?: string(name='Detail', description='The information about the diagnostic result.', example='The query consumes a large amount of memory resources. Perform memory optimization on the query.'),
              operatorId?: string(name='OperatorId', description='The operator ID.', example='Join[234]'),
              stageId?: string(name='StageId', description='The stage ID.', example='Stage[1]'),
            }
          ](name='DiagnosisResults', description='The diagnostic result items.'),
          operatorCost?: long(name='OperatorCost', description='The total CPU time consumed by all operators in the stage, which is equivalent to the total CPU time of the stage. You can use this parameter to determine which parts of the stage consume a large amount of computing resources. Unit: milliseconds.', example='12345'),
          outputDataSize?: long(name='OutputDataSize', description='The amount of returned data. Unit: bytes.', example='1234'),
          patternId?: string(name='PatternId', description='The SQL pattern ID.', example='-5978869478527645300'),
          peakMemory?: long(name='PeakMemory', description='The peak memory.', example='1234'),
          processId?: string(name='ProcessId', description='The query ID.', example='2023120808405202104101604703151654257'),
          SQL?: string(name='SQL', description='The SQL statement.

>  For performance considerations, an SQL statement cannot exceed 5,120 characters in length. Otherwise, the SQL statement is truncated. You can call the [DownloadDiagnosisRecords](https://help.aliyun.com/document_detail/308212.html) operation to download the information about SQL statements that meet a query condition for an AnalyticDB for MySQL cluster, including the complete SQL statements.', example='select * from user'),
          scanSize?: long(name='ScanSize', description='The amount of scanned data. Unit: bytes.', example='1234'),
          startTime?: string(name='StartTime', description='The start time of the query. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time is displayed in UTC.', example='2024-05-05T02:13Z'),
          totalStages?: int32(name='TotalStages', description='The total number of stages generated.', example='123'),
        }
      ](name='Results', description='The detection result items.'),
      status?: string(name='Status', description='The severity level of the detection result. Valid values:', example='NORMAL
WARNNING
CRITICAL'),
    }
  ](name='DetectionItems', description='The queried detection items and detection results.'),
  requestId?: string(name='RequestId', description='The request ID.', example='32C6E870-81E5-5E2A-BE7D-F9623F090DAB'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='5'),
}

model DescribeBadSqlDetectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBadSqlDetectionResponseBody(name='body'),
}

/**
 * @summary Queries the bad SQL statements that affect cluster stability within a time range.
 *
 * @param request DescribeBadSqlDetectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeBadSqlDetectionResponse
 */
async function describeBadSqlDetectionWithOptions(request: DescribeBadSqlDetectionRequest, runtime: Util.RuntimeOptions): DescribeBadSqlDetectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBadSqlDetection',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the bad SQL statements that affect cluster stability within a time range.
 *
 * @param request DescribeBadSqlDetectionRequest
 * @return DescribeBadSqlDetectionResponse
 */
async function describeBadSqlDetection(request: DescribeBadSqlDetectionRequest): DescribeBadSqlDetectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBadSqlDetectionWithOptions(request, runtime);
}

model DescribeColumnsRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  schemaName?: string(name='SchemaName', description='The name of the database.

This parameter is required.', example='adb_demo'),
  tableName?: string(name='TableName', description='The name of the table.

This parameter is required.', example='test'),
}

model DescribeColumnsResponseBody = {
  items?: {
    column?: [ 
    {
      autoIncrementColumn?: boolean(name='AutoIncrementColumn', description='Indicates whether the column is auto-incremented.', example='true'),
      columnName?: string(name='ColumnName', description='The name of the column.', example='id'),
      DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-bp1xxxxxxxx47'),
      primaryKey?: boolean(name='PrimaryKey', description='Indicates whether the column is a primary key column.', example='false'),
      schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
      tableName?: string(name='TableName', description='The name of the table.', example='test'),
      type?: string(name='Type', description='The data type of the column.', example='bigint'),
    }
  ](name='Column')
  }(name='Items', description='The queried columns.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeColumnsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeColumnsResponseBody(name='body'),
}

/**
 * @summary Queries a list of columns in a table within an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeColumnsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeColumnsResponse
 */
async function describeColumnsWithOptions(request: DescribeColumnsRequest, runtime: Util.RuntimeOptions): DescribeColumnsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.schemaName)) {
    query['SchemaName'] = request.schemaName;
  }
  if (!Util.isUnset(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeColumns',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of columns in a table within an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeColumnsRequest
 * @return DescribeColumnsResponse
 */
async function describeColumns(request: DescribeColumnsRequest): DescribeColumnsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeColumnsWithOptions(request, runtime);
}

model DescribeComputeResourceRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-bp1r053byu48p****'),
  DBClusterVersion?: string(name='DBClusterVersion', description='The version of the AnalyticDB for MySQL Data Warehouse Edition cluster. Set the value to **3.0**.', example='3.0'),
  migrate?: boolean(name='Migrate', description='Specifies whether to query the specifications of the available computing resources that are migrated from AnalyticDB for MySQL Data Warehouse Edition to Data Lakehouse Edition. Valid values:

*   **true**
*   **false** (default)', example='false'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  zoneId?: string(name='ZoneId', description='The zone ID of the cluster.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/129857.html) operation to query the most recent zone list.', example='cn-beijing-f'),
}

model DescribeComputeResourceResponseBody = {
  computeResource?: [ 
    {
      displayValue?: string(name='DisplayValue', description='The specifications of computing resources displayed in the console.', example='8 Core 32 GB'),
      realValue?: string(name='RealValue', description='The actual specifications of computing resources.', example='8 Core 32 GB'),
    }
  ](name='ComputeResource', description='The queried specifications of computing resources.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEAW'),
}

model DescribeComputeResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeComputeResourceResponseBody(name='body'),
}

/**
 * @summary Queries the specifications of computing resources for AnalyticDB for MySQL Data Warehouse Edition clusters within a region.
 *
 * @param request DescribeComputeResourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeComputeResourceResponse
 */
async function describeComputeResourceWithOptions(request: DescribeComputeResourceRequest, runtime: Util.RuntimeOptions): DescribeComputeResourceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.DBClusterVersion)) {
    query['DBClusterVersion'] = request.DBClusterVersion;
  }
  if (!Util.isUnset(request.migrate)) {
    query['Migrate'] = request.migrate;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeComputeResource',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the specifications of computing resources for AnalyticDB for MySQL Data Warehouse Edition clusters within a region.
 *
 * @param request DescribeComputeResourceRequest
 * @return DescribeComputeResourceResponse
 */
async function describeComputeResource(request: DescribeComputeResourceRequest): DescribeComputeResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeComputeResourceWithOptions(request, runtime);
}

model DescribeConnectionCountRecordsRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-bp1jj9xqft1po****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeConnectionCountRecordsResponseBody = {
  accessIpRecords?: [ 
    {
      accessIp?: string(name='AccessIp', description='The IP address of the client.', example='42.120.XX.XX'),
      count?: long(name='Count', description='The number of connections.', example='1'),
    }
  ](name='AccessIpRecords', description='The queried client IP addresses.'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-bp1jj9xqft1po****'),
  requestId?: string(name='RequestId', description='The request ID.', example='562C7F89-FBE6-4A04-AAAA-7EBC25******'),
  userRecords?: [ 
    {
      count?: long(name='Count', description='The number of connections.', example='1'),
      user?: string(name='User', description='The username of the database account.', example='test'),
    }
  ](name='UserRecords', description='The queried database accounts.'),
}

model DescribeConnectionCountRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeConnectionCountRecordsResponseBody(name='body'),
}

/**
 * @summary Queries the current number of connections to an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeConnectionCountRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeConnectionCountRecordsResponse
 */
async function describeConnectionCountRecordsWithOptions(request: DescribeConnectionCountRecordsRequest, runtime: Util.RuntimeOptions): DescribeConnectionCountRecordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeConnectionCountRecords',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the current number of connections to an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeConnectionCountRecordsRequest
 * @return DescribeConnectionCountRecordsResponse
 */
async function describeConnectionCountRecords(request: DescribeConnectionCountRecordsRequest): DescribeConnectionCountRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeConnectionCountRecordsWithOptions(request, runtime);
}

model DescribeControllerDetectionRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a region.

This parameter is required.', example='amv-xxxx'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time must be in UTC.

>  The end time must be later than the start time.', example='2024-06-23T02:21Z'),
  lang?: string(name='Lang', description='The language. Valid values:

*   **zh**: simplified Chinese.
*   **en**: English.', example='zh'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-beijing'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time must be in UTC.', example='2021-05-03T15:00Z'),
}

model DescribeControllerDetectionResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-xxx'),
  detectionItems?: [ 
    {
      message?: string(name='Message', description='The information about the detection result.', example='A CPU increase is detected on the access node.'),
      name?: string(name='Name', description='The name of the detection item.', example='CPU increase detection'),
      status?: string(name='Status', description='The severity level of the detection result. Valid values:

*   NORMAL
*   WARNING
*   CRITICAL', example='NORMAL
WARNING
CRITICAL'),
    }
  ](name='DetectionItems', description='The queried detection items and detection results.'),
  requestId?: string(name='RequestId', description='The request ID.', example='D9856CFD-10DC-50AF-AE29-07C30FC57B86'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='8'),
}

model DescribeControllerDetectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeControllerDetectionResponseBody(name='body'),
}

/**
 * @summary Queries the diagnostic results of the access layer.
 *
 * @param request DescribeControllerDetectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeControllerDetectionResponse
 */
async function describeControllerDetectionWithOptions(request: DescribeControllerDetectionRequest, runtime: Util.RuntimeOptions): DescribeControllerDetectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeControllerDetection',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the diagnostic results of the access layer.
 *
 * @param request DescribeControllerDetectionRequest
 * @return DescribeControllerDetectionResponse
 */
async function describeControllerDetection(request: DescribeControllerDetectionRequest): DescribeControllerDetectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeControllerDetectionWithOptions(request, runtime);
}

model DescribeDBClusterAccessWhiteListRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='rm-uf6wjk5xxxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.', example='cn-qingdao'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeDBClusterAccessWhiteListResponseBody = {
  items?: {
    IPArray?: [ 
    {
      DBClusterIPArrayAttribute?: string(name='DBClusterIPArrayAttribute', description='The attribute of the IP address whitelist. By default, this parameter is empty.

>  The IP address whitelists that have the **hidden** attribute are not displayed in the console. These IP address whitelists are used to access services such as Data Transmission Service (DTS) and PolarDB-X.', example='hidden'),
      DBClusterIPArrayName?: string(name='DBClusterIPArrayName', description='The name of the IP address whitelist.

*   The name of an IP address whitelist must be 2 to 32 characters in length. The name can contain lowercase letters, digits, and underscores (_). The name must start with a lowercase letter and end with a lowercase letter or digit.
*   Each cluster supports up to 50 IP address whitelists.', example='test'),
      securityIPList?: string(name='SecurityIPList', description='The IP addresses in the IP address whitelist. Up to 1,000 IP addresses can be returned. Multiple IP addresses are separated by commas (,).', example='127.0.0.1'),
    }
  ](name='IPArray')
  }(name='Items', description='The queried IP address whitelists.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeDBClusterAccessWhiteListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBClusterAccessWhiteListResponseBody(name='body'),
}

/**
 * @summary Queries a list of IP address whitelists for an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeDBClusterAccessWhiteListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBClusterAccessWhiteListResponse
 */
async function describeDBClusterAccessWhiteListWithOptions(request: DescribeDBClusterAccessWhiteListRequest, runtime: Util.RuntimeOptions): DescribeDBClusterAccessWhiteListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBClusterAccessWhiteList',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of IP address whitelists for an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeDBClusterAccessWhiteListRequest
 * @return DescribeDBClusterAccessWhiteListResponse
 */
async function describeDBClusterAccessWhiteList(request: DescribeDBClusterAccessWhiteListRequest): DescribeDBClusterAccessWhiteListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBClusterAccessWhiteListWithOptions(request, runtime);
}

model DescribeDBClusterAttributeRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a region.

This parameter is required.', example='am-bp111m2cfrdl1****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeDBClusterAttributeResponseBody = {
  items?: {
    DBCluster?: [ 
    {
      category?: string(name='Category', description='The edition of the cluster. Valid values:

*   **BASIC**: reserved mode for Basic Edition.
*   **CLUSTER**: reserved mode for Cluster Edition.
*   **MIXED_STORAGE**: elastic mode for Cluster Edition.

>  For more information about cluster editions, see [Editions](https://help.aliyun.com/document_detail/205001.html).', example='MIXED_STORAGE'),
      commodityCode?: string(name='CommodityCode', description='The billing method of the cluster. Valid values:

*   **ads**: pay-as-you-go.
*   **ads_pre**: subscription.', example='ads'),
      computeResource?: string(name='ComputeResource', description='The specifications of computing resources that are used in the cluster in elastic mode. Computing resources are used to compute data. The increase in the computing resources can accelerate queries. You can scale computing resources based on your business requirements.', example='8Core32GB'),
      connectionString?: string(name='ConnectionString', description='The Virtual Private Cloud (VPC) endpoint that is used to connect to the cluster.', example='am-bp111m2cfrdl1****.ads.aliyuncs.com'),
      creationTime?: string(name='CreationTime', description='The time when the cluster was created. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time is displayed in UTC.', example='2021-04-01T09:50:18Z'),
      DBClusterDescription?: string(name='DBClusterDescription', description='The description of the cluster.', example='adb_test'),
      DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.', example='am-bp111m2cfrdl1****'),
      DBClusterNetworkType?: string(name='DBClusterNetworkType', description='The network type of the cluster. **VPC** is returned.', example='vpc'),
      DBClusterStatus?: string(name='DBClusterStatus', description='The status of the cluster. For more information, see [Cluster states](https://help.aliyun.com/document_detail/143075.html).', example='Running'),
      DBClusterType?: string(name='DBClusterType', description='The type of the cluster. Valid values:

*   **Common**: common cluster.
*   **RDS_ANALYSIS**: MySQL analytic instance.', example='Common'),
      DBNodeClass?: string(name='DBNodeClass', description='The instance type of the cluster.', example='E8'),
      DBNodeCount?: long(name='DBNodeCount', description='The number of node groups.', example='1'),
      DBNodeStorage?: long(name='DBNodeStorage', description='The storage capacity of the cluster. Unit: GB.', example='300'),
      DBVersion?: string(name='DBVersion', description='The engine version of the cluster. **3.0** is returned.', example='3.0'),
      diskEncryption?: boolean(name='DiskEncryption', description='Indicates whether disk encryption is enabled. Valid values:

*   true
*   false', example='false'),
      diskPerformanceLevel?: string(name='DiskPerformanceLevel', description='The ESSD performance level.', example='PL1'),
      diskType?: string(name='DiskType', description='The disk type of the cluster. Valid values:

*   **local_ssd**: local disk.
*   **cloud**: basic disk.
*   **cloud_ssd**: standard SSD.
*   **cloud_efficiency**: ultra disk.
*   **cloud_essd0**: PL0 Enterprise SSD (ESSD).
*   **cloud_essd**: PL1 ESSD.
*   **cloud_essd2**: PL2 ESSD.
*   **cloud_essd3**: PL3 ESSD.

>  For more information about ESSDs, see [ESSDs](https://help.aliyun.com/document_detail/122389.html).', example='cloud_essd'),
      dtsJobId?: string(name='DtsJobId', description='The ID of the Data Transmission Service (DTS) synchronization job. This parameter is returned only for MySQL analytic instances.', example='dtsb1hp3790****'),
      elasticIOResource?: int32(name='ElasticIOResource', description='The number of elastic I/O units (EIUs).', example='2'),
      elasticIOResourceSize?: string(name='ElasticIOResourceSize', description='The single-node specifications of an EIU. Valid values:

*   8Core64GB: If this value is returned, the specifications of an EIU are 24 cores and 192 GB memory.
*   12Core96GB: If this value is returned, the specifications of an EIU are 36 cores and 288 GB memory.', example='8Core64GB'),
      enableAirflow?: boolean(name='EnableAirflow', description='Indicates whether an Airflow cluster was created. Valid values:

*   **true**
*   **false**', example='true'),
      enableSpark?: boolean(name='EnableSpark', description='Indicates whether a Spark cluster was created. Valid values:

*   **true**
*   **false**', example='false'),
      engine?: string(name='Engine', description='The database engine of the cluster. **AnalyticDB** is returned.', example='AnalyticDB'),
      engineVersion?: string(name='EngineVersion', description='The minor version of the cluster.', example='3.1.1.9'),
      executorCount?: string(name='ExecutorCount', description='The number of compute nodes that are used by the cluster in elastic mode.', example='1'),
      expireTime?: string(name='ExpireTime', description='The expiration time of the cluster. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time is displayed in UTC. Example: *2999-09-08T16:00:00Z*.

> 

*   If the billing method of the cluster is subscription, the actual expiration time is returned.

*   If the billing method of the cluster is pay-as-you-go, **2999-09-08T16:00:00Z** is returned.', example='2999-09-08T16:00:00Z'),
      expired?: string(name='Expired', description='Indicates whether the cluster has expired. Valid values:

*   **true**
*   **false**', example='false'),
      innerIp?: string(name='InnerIp', description='The public IP address of the cluster.', example='10.1.XX.XX'),
      innerPort?: string(name='InnerPort', description='The public port number.', example='3306'),
      kmsId?: string(name='KmsId', description='The ID of the key that is used to encrypt disk data.

>  This parameter is returned only when disk encryption is enabled.', example='e1935511-cf88-1123-a0f8-1be8d251****'),
      lockMode?: string(name='LockMode', description='The lock mode of the cluster. Valid values:

*   **Unlock**: The cluster is not locked.
*   **ManualLock**: The cluster is manually locked.
*   **LockByExpiration**: The cluster is automatically locked due to cluster expiration.
*   **LockByRestoration**: The cluster is automatically locked due to cluster restoration.
*   **LockByDiskQuota**: The cluster is automatically locked when 90% of the cluster storage is used.', example='Unlock'),
      lockReason?: string(name='LockReason', description='The reason why the cluster is locked.

>  This parameter is returned only when the cluster was locked. **instance_expire** is returned.', example='instance_expired'),
      maintainTime?: string(name='MaintainTime', description='The maintenance window of the cluster. The time is displayed in the *HH:mmZ-HH:mmZ* format in UTC. Example: *04:00Z-05:00Z*, which indicates that routine maintenance is performed from 04:00 to 05:00.

>  For more information about maintenance windows, see [Configure a maintenance window](https://help.aliyun.com/document_detail/122569.html).', example='04:00Z-05:00Z'),
      mode?: string(name='Mode', description='The mode of the cluster. Valid values:

*   **flexible**: elastic mode.
*   **reserver**: reserved mode.

>  For more information about cluster modes, see [Editions](https://help.aliyun.com/document_detail/205001.html).', example='flexible'),
      payType?: string(name='PayType', description='The billing method of the cluster. Valid values:

*   **Postpaid**: pay-as-you-go.
*   **Prepaid**: subscription.', example='Postpaid'),
      port?: int32(name='Port', description='The port number that is used to connect to the cluster.', example='3306'),
      productForm?: string(name='ProductForm'),
      productVersion?: string(name='ProductVersion', description='The edition of the cluster. Valid values:

*   **BasicVersion**: Basic Edition.
*   **EnterpriseVersion**: Enterprise Edition.', example='BasicVersion'),
      rdsInstanceId?: string(name='RdsInstanceId', description='The ID of the ApsaraDB RDS instance from which data is synchronized to the cluster. This parameter is returned only for MySQL analytic instances.', example='rm-bp837jsdp2****'),
      regionId?: string(name='RegionId', description='The region ID of the cluster.', example='cn-hangzhou'),
      reservedNodeCount?: int32(name='ReservedNodeCount'),
      reservedNodeSize?: string(name='ReservedNodeSize'),
      resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmyiu4ekp****'),
      secondaryVSwitchId?: string(name='SecondaryVSwitchId', description='The ID of the secondary vSwitch.

>  You cannot set this parameter to a value that is the same as that of the VSwitchId parameter.', example='vsw-0jlb72a9dan1ja9cvg9tf'),
      secondaryZoneId?: string(name='SecondaryZoneId', description='The ID of the secondary zone.

>  You cannot set this parameter to a value that is the same as that of the ZoneId parameter.', example='cn-zhangjiakou-b'),
      storageResource?: string(name='StorageResource', description='The specifications of storage resources that are used in the cluster in elastic mode. Storage resources are used to read and write data. The increase in the storage resources can improve the read and write performance of the cluster.', example='8Core32GB'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key', description='The tag key.

>  You can call the [TagResources](https://help.aliyun.com/document_detail/179253.html) operation to add a tag to the cluster.', example='tag1'),
          value?: string(name='Value', description='The tag value.', example='test1'),
        }
      ](name='Tag')
      }(name='Tags', description='The tags that are added to the cluster.'),
      taskInfo?: {
        name?: string(name='Name', description='The name of the job.', example='analyticDBFlexibleScaleOut'),
        progress?: string(name='Progress', description='The progress of the job. Unit: %.', example='10'),
        status?: string(name='Status', description='The status of the job. Valid values:

*   **NOT_RUN**
*   **RUNNING**
*   **SUCCEED**', example='RUNNING'),
        stepList?: {
          stepList?: [ 
          {
            endTime?: string(name='EndTime', description='The end time of the job step. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.', example='2024-03-10T10:28:34Z'),
            startTime?: string(name='StartTime', description='The start time of the job step. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.', example='2024-03-10T09:28:34Z'),
            stepDesc?: string(name='StepDesc', description='The description of the job step.', example='Apply resource'),
            stepName?: string(name='StepName', description='The name of the job step.', example='ApplyResource'),
            stepProgress?: string(name='StepProgress', description='The progress of the job step. Unit: %.', example='50'),
            stepStatus?: string(name='StepStatus', description='The status of the job step. Valid values:

*   **NOT_RUN**
*   **RUNNING**
*   **SUCCEED**', example='SUCCEED'),
          }
        ](name='StepList')
        }(name='StepList', description='The job steps.'),
      }(name='TaskInfo', description='The job information.'),
      userENIStatus?: boolean(name='UserENIStatus', description='Indicates whether Elastic Network Interface (ENI) is enabled. Valid values:

*   **true**
*   **false**', example='true'),
      VPCCloudInstanceId?: string(name='VPCCloudInstanceId', description='The ID of the cluster that resides in the VPC.', example='am-bp111m2cfrdl1****-controller'),
      VPCId?: string(name='VPCId', description='The VPC ID of the cluster.', example='vpc-bp13h7uzhulpuxvnp****'),
      vSwitchId?: string(name='VSwitchId', description='The vSwitch ID of the cluster.', example='vsw-bp1syh8vvw8yech7n****'),
      zoneId?: string(name='ZoneId', description='The zone ID of the cluster.', example='cn-hangzhou-h'),
    }
  ](name='DBCluster')
  }(name='Items', description='The queried cluster information.'),
  requestId?: string(name='RequestId', description='The request ID.', example='2895BB82-B2C1-408E-AA73-DB8D59******'),
}

model DescribeDBClusterAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBClusterAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the information about an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeDBClusterAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBClusterAttributeResponse
 */
async function describeDBClusterAttributeWithOptions(request: DescribeDBClusterAttributeRequest, runtime: Util.RuntimeOptions): DescribeDBClusterAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBClusterAttribute',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeDBClusterAttributeRequest
 * @return DescribeDBClusterAttributeResponse
 */
async function describeDBClusterAttribute(request: DescribeDBClusterAttributeRequest): DescribeDBClusterAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBClusterAttributeWithOptions(request, runtime);
}

model DescribeDBClusterHealthStatusRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the cluster IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a specific region.

This parameter is required.', example='am-bp1d8lbdj22rx****'),
  regionId?: string(name='RegionId', description='The ID of the region.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeDBClusterHealthStatusResponseBody = {
  CS?: {
    activeCount?: long(name='ActiveCount', description='The number of healthy access nodes.', example='2'),
    expectedCount?: long(name='ExpectedCount', description='The total number of access nodes.', example='2'),
    riskCount?: long(name='RiskCount', description='The number of risky access nodes.', example='0'),
    status?: string(name='Status', description='The health state of access nodes. Valid values:

*   **RISK**: risky
*   **NORMAL**: healthy
*   **UNAVAILABLE**: unavailable', example='NORMAL'),
    unavailableCount?: long(name='UnavailableCount', description='The number of unavailable access nodes.', example='0'),
  }(name='CS', description='Health state details of access nodes.'),
  executor?: {
    activeCount?: long(name='ActiveCount', description='The number of healthy compute node groups.', example='2'),
    expectedCount?: long(name='ExpectedCount', description='The total number of compute node groups.', example='2'),
    riskCount?: long(name='RiskCount', description='The number of risky compute node groups.', example='0'),
    status?: string(name='Status', description='The health state of compute node groups. Valid values:

*   **RISK**: risky
*   **NORMAL**: healthy
*   **UNAVAILABLE**: unavailable', example='NORMAL'),
    unavailableCount?: long(name='UnavailableCount', description='The number of unavailable compute node groups.', example='0'),
  }(name='Executor', description='Health state details of compute node groups.'),
  instanceStatus?: string(name='InstanceStatus', description='The health state of the cluster. Valid values:

*   **RISK**: risky

*   **NORMAL**: healthy

*   **UNAVAILABLE**: unavailable

> If the health states of access nodes, compute node groups, and storage node groups are all **healthy** and the cluster is detected to be alive, the health state of the cluster is **healthy**. If the preceding three health states include **risky**, the health state of the cluster is **risky**. If the preceding three health states include **unavailable**, the health state of the cluster is **unavailable**.', example='NORMAL'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEA'),
  worker?: {
    activeCount?: long(name='ActiveCount', description='The number of healthy storage node groups.', example='2'),
    expectedCount?: long(name='ExpectedCount', description='The total number of storage node groups.', example='2'),
    riskCount?: long(name='RiskCount', description='The number of risky storage node groups.', example='0'),
    status?: string(name='Status', description='The health state of storage node groups. Valid values:

*   **RISK**: risky
*   **NORMAL**: healthy
*   **UNAVAILABLE**: unavailable', example='NORMAL'),
    unavailableCount?: long(name='UnavailableCount', description='The number of unavailable storage node groups.', example='0'),
  }(name='Worker', description='Health state details of storage node groups.'),
}

model DescribeDBClusterHealthStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBClusterHealthStatusResponseBody(name='body'),
}

/**
 * @summary 查询集群健康检查状态
 *
 * @param request DescribeDBClusterHealthStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBClusterHealthStatusResponse
 */
async function describeDBClusterHealthStatusWithOptions(request: DescribeDBClusterHealthStatusRequest, runtime: Util.RuntimeOptions): DescribeDBClusterHealthStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBClusterHealthStatus',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询集群健康检查状态
 *
 * @param request DescribeDBClusterHealthStatusRequest
 * @return DescribeDBClusterHealthStatusResponse
 */
async function describeDBClusterHealthStatus(request: DescribeDBClusterHealthStatusRequest): DescribeDBClusterHealthStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBClusterHealthStatusWithOptions(request, runtime);
}

model DescribeDBClusterNetInfoRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeDBClusterNetInfoResponseBody = {
  clusterNetworkType?: string(name='ClusterNetworkType', description='The network type of the cluster.', example='VPC'),
  items?: {
    address?: [ 
    {
      connectionString?: string(name='ConnectionString', description='The endpoint of the cluster.', example='am-bpxxxxxxxx.ads.aliyuncs.com'),
      connectionStringPrefix?: string(name='ConnectionStringPrefix', description='The prefix of the cluster endpoint.', example='am-bpxxxxxxxx89k51380'),
      IPAddress?: string(name='IPAddress', description='The IP address.', example='192.168.x.x'),
      netType?: string(name='NetType', description='The network type of the cluster. Valid values:

*   **Public**: public endpoint.
*   **VPC**: Virtual Private Cloud (VPC) endpoint.', example='VPC'),
      port?: string(name='Port', description='The port number that is used to connect to the cluster.', example='3306'),
      VPCId?: string(name='VPCId', description='The VPC ID.

>  If NetType is set to Public, an empty string is returned for this parameter.', example='vpc-xxxxxxxxx'),
      vSwitchId?: string(name='VSwitchId', description='The vSwitch ID.

>  If NetType is set to Public, an empty string is returned for this parameter.', example='vsw-xxxxxx'),
    }
  ](name='Address')
  }(name='Items', description='The queried network information about the cluster.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeDBClusterNetInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBClusterNetInfoResponseBody(name='body'),
}

/**
 * @summary Queries the network information about an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeDBClusterNetInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBClusterNetInfoResponse
 */
async function describeDBClusterNetInfoWithOptions(request: DescribeDBClusterNetInfoRequest, runtime: Util.RuntimeOptions): DescribeDBClusterNetInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBClusterNetInfo',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the network information about an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeDBClusterNetInfoRequest
 * @return DescribeDBClusterNetInfoResponse
 */
async function describeDBClusterNetInfo(request: DescribeDBClusterNetInfoRequest): DescribeDBClusterNetInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBClusterNetInfoWithOptions(request, runtime);
}

model DescribeDBClusterPerformanceRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='am-************'),
  endTime?: string(name='EndTime', description='The end time of the query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time must be in UTC.

> The end time must be later than the start time. The maximum time range that can be specified is two days.', example='2021-05-03T15:01Z'),
  key?: string(name='Key', description='The key of the performance metric that you want to query. Separate multiple keys with commas (,). For more information about the performance metrics, see [Metric overview](https://help.aliyun.com/document_detail/2863211.html).', example='AnalyticDB_CPU'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourcePools?: string(name='ResourcePools', description='The name of the resource group.', example='test'),
  startTime?: string(name='StartTime', description='The start time of the query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time must be in UTC.', example='2021-05-03T15:00Z'),
}

model DescribeDBClusterPerformanceResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The information about the request denial. This parameter is returned only if Resource Access Management (RAM) permission verification failed.', example='{
  "AuthAction": "xxx",
  "AuthPrincipalDisplayName": "sampleName",
  "AuthPrincipalOwnerId": "111111111111111111",
  "AuthPrincipalType": "SubUser",
  "AuthResource": "xxx",
  "NoPermissionType": "xxx",
  "PolicyType": "xxx"
}'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-************'),
  endTime?: string(name='EndTime', description='The end time of the query. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time is displayed in UTC.', example='2021-05-03T15:01:00Z'),
  performances?: [ 
    {
      key?: string(name='Key', description='The name of the performance metric.', example='AnalyticDB_CPU'),
      series?: [ 
        {
          name?: string(name='Name', description='The name of the performance metric value. For more information about the performance metrics, see [Metric overview](https://help.aliyun.com/document_detail/2863211.html).', example='worker_avg_cpu_used'),
          tags?: string(name='Tags', description='The tags that are added to the cluster.', example='instance_name: "amv-8vbf80pjcz*****"'),
          translateKey?: string(name='TranslateKey', description='The key that is used to obtain the name of the performance metric value.', example='elastic_executor_avg_cpu_use'),
          values?: [ string ](name='Values', description='The values of the queried performance metric.'),
        }
      ](name='Series', description='The queried performance metric data.'),
      unit?: string(name='Unit', description='The unit of the performance metric.', example='%'),
    }
  ](name='Performances', description='The queried performance metrics.'),
  requestId?: string(name='RequestId', description='The request ID.', example='25B56BC7-4978-40B3-9E48-4B7067******'),
  startTime?: string(name='StartTime', description='The start time of the query. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time is displayed in UTC.', example='2021-05-03T15:00:00Z'),
}

model DescribeDBClusterPerformanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBClusterPerformanceResponseBody(name='body'),
}

/**
 * @summary Queries the performance data of an AnalyticDB for MySQL cluster.
 *
 * @description You can call this operation to query the performance data of a cluster over a time range based on its performance metrics. The data is collected every 30 seconds. This operation allows you to query information about slow queries, such as the SQL query duration, number of scanned rows, and amount of scanned data.
 *
 * @param request DescribeDBClusterPerformanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBClusterPerformanceResponse
 */
async function describeDBClusterPerformanceWithOptions(request: DescribeDBClusterPerformanceRequest, runtime: Util.RuntimeOptions): DescribeDBClusterPerformanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.key)) {
    query['Key'] = request.key;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourcePools)) {
    query['ResourcePools'] = request.resourcePools;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBClusterPerformance',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the performance data of an AnalyticDB for MySQL cluster.
 *
 * @description You can call this operation to query the performance data of a cluster over a time range based on its performance metrics. The data is collected every 30 seconds. This operation allows you to query information about slow queries, such as the SQL query duration, number of scanned rows, and amount of scanned data.
 *
 * @param request DescribeDBClusterPerformanceRequest
 * @return DescribeDBClusterPerformanceResponse
 */
async function describeDBClusterPerformance(request: DescribeDBClusterPerformanceRequest): DescribeDBClusterPerformanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBClusterPerformanceWithOptions(request, runtime);
}

model DescribeDBClusterResourcePoolPerformanceRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-****************'),
  endTime?: string(name='EndTime', description='The end of the time range to monitor the resource group. The end time must be later than the start time. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time must be in UTC.

This parameter is required.', example='2021-06-10T07:01Z'),
  key?: string(name='Key', description='The metrics of the resource group. You can enter multiple metrics at the same time to query the monitoring information. Separate multiple metrics with commas (,). Valid values:

*   **AnalyticDB_RP_CPU**: the average CPU utilization. Unit: %.
*   **AnalyticDB_RP_RT**: the query response time (RT). Unit: milliseconds.
*   **AnalyticDB_RP_QPS**: the queries per second (QPS). The value of this parameter must be a numeric value.
*   **AnalyticDB_RP_WaitTime**: the query waiting time. Unit: milliseconds.
*   **AnalyticDB_RP_OriginalNode**: the number of basic nodes in the resource group.
*   **AnalyticDB_RP_ActualNode**: the number of scheduled nodes that are scaled out in the resource group.
*   **AnalyticDB_RP_PlanNode**: the number of scheduled nodes to be scaled out in the resource group.
*   **AnalyticDB_RP_TotalNode**: the total number of nodes in the resource group. Total number of nodes = Number of basic nodes + Number of scheduled nodes that are scaled out.

> 

*   If you leave this parameter empty, the monitoring information about all metrics is returned.

*   For more information about scaling plans, see [Create a resource scaling plan](https://help.aliyun.com/document_detail/189507.html).', example='AnalyticDB_RP_CPU'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourcePools?: string(name='ResourcePools', description='The names of the resource groups that you want to query. You can enter multiple names of resource groups. Separate multiple names with commas (,).

> 

*   The value of this parameter is case-insensitive. For example, `USER_DEFAULT` and `user_default` specify the same resource group.

*   If you leave this parameter empty, the monitoring information about the `USER_DEFAULT` resource group is returned.', example='TEST_POOL'),
  startTime?: string(name='StartTime', description='The beginning of the time range to monitor the resource group. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time must be in UTC.

> You can view only the monitoring information about the resource groups within the last two days.

This parameter is required.', example='2021-06-10T07:00Z'),
}

model DescribeDBClusterResourcePoolPerformanceResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-****************'),
  endTime?: string(name='EndTime', description='The end of the time range for monitoring the resource group. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time is displayed in UTC.', example='2021-06-10T07:01:00Z'),
  performances?: [ 
    {
      key?: string(name='Key', description='The metric of the resource group.', example='AnalyticDB_RP_CPU'),
      resourcePoolPerformances?: [ 
        {
          resourcePoolName?: string(name='ResourcePoolName', description='The name of the resource group.', example='test_pool'),
          resourcePoolSeries?: [ 
            {
              name?: string(name='Name', description='The name of the metric.', example='cpu'),
              values?: [ string ](name='Values', description='The value of the metric.'),
            }
          ](name='ResourcePoolSeries', description='The sequential monitoring information about the resource groups.'),
        }
      ](name='ResourcePoolPerformances', description='The queried monitoring information about the resource groups.'),
      unit?: string(name='Unit', description='The unit of the metric value.', example='%'),
    }
  ](name='Performances', description='The queried monitoring information about the metrics.'),
  requestId?: string(name='RequestId', description='The request ID.', example='C7EDB8E4-9769-4233-88C7-DCA4C9******'),
  startTime?: string(name='StartTime', description='The beginning of the time range for monitoring the resource group. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time is displayed in UTC.', example='2021-06-10T07:00:00'),
}

model DescribeDBClusterResourcePoolPerformanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBClusterResourcePoolPerformanceResponseBody(name='body'),
}

/**
 * @summary Queries the monitoring information about resource groups within an AnalyticDB for MySQL cluster.
 *
 * @description > You can also view the monitoring information about resource groups within an AnalyticDB for MySQL cluster in elastic mode for Cluster Edition in the form of graphs in the console. For more information, see [View monitoring information](https://help.aliyun.com/document_detail/188721.html).
 *
 * @param request DescribeDBClusterResourcePoolPerformanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBClusterResourcePoolPerformanceResponse
 */
async function describeDBClusterResourcePoolPerformanceWithOptions(request: DescribeDBClusterResourcePoolPerformanceRequest, runtime: Util.RuntimeOptions): DescribeDBClusterResourcePoolPerformanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.key)) {
    query['Key'] = request.key;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourcePools)) {
    query['ResourcePools'] = request.resourcePools;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBClusterResourcePoolPerformance',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the monitoring information about resource groups within an AnalyticDB for MySQL cluster.
 *
 * @description > You can also view the monitoring information about resource groups within an AnalyticDB for MySQL cluster in elastic mode for Cluster Edition in the form of graphs in the console. For more information, see [View monitoring information](https://help.aliyun.com/document_detail/188721.html).
 *
 * @param request DescribeDBClusterResourcePoolPerformanceRequest
 * @return DescribeDBClusterResourcePoolPerformanceResponse
 */
async function describeDBClusterResourcePoolPerformance(request: DescribeDBClusterResourcePoolPerformanceRequest): DescribeDBClusterResourcePoolPerformanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBClusterResourcePoolPerformanceWithOptions(request, runtime);
}

model DescribeDBClusterSSLRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a region.

This parameter is required.', example='am-bp1ub9grke1****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/612293.html) operation to query the most recent region list.'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeDBClusterSSLResponseBody = {
  connectionString?: string(name='ConnectionString', description='The endpoint that is protected by SSL encryption.', example='am-d7oualxo05x4o5be872***.ads.aliyuncs.com'),
  expireTime?: string(name='ExpireTime', description='The time when the SSL certificate expires. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2022-10-11T08:16:43Z'),
  requestId?: string(name='RequestId', description='The request ID.', example='348303D8-6F42-5141-9B00-A6EECA1E37B6'),
  SSLEnabled?: boolean(name='SSLEnabled', description='Indicates whether SSL encryption is enabled. Valid values:

*   true
*   false', example='true'),
}

model DescribeDBClusterSSLResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBClusterSSLResponseBody(name='body'),
}

/**
 * @summary Queries the SSL configurations of an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.
 *
 * @param request DescribeDBClusterSSLRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBClusterSSLResponse
 */
async function describeDBClusterSSLWithOptions(request: DescribeDBClusterSSLRequest, runtime: Util.RuntimeOptions): DescribeDBClusterSSLResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBClusterSSL',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the SSL configurations of an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.
 *
 * @param request DescribeDBClusterSSLRequest
 * @return DescribeDBClusterSSLResponse
 */
async function describeDBClusterSSL(request: DescribeDBClusterSSLRequest): DescribeDBClusterSSLResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBClusterSSLWithOptions(request, runtime);
}

model DescribeDBClusterShardNumberRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='am-uf6g8w25jacm7****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeDBClusterShardNumberResponseBody = {
  availableShardNumberList?: [ 
    {
      shardNumber?: int32(name='ShardNumber', description='The number of shards.', example='128'),
    }
  ](name='AvailableShardNumberList', description='The supported numbers of shards, including the number of current shards and the number of desired shards.'),
  availableShardNumbers?: [ int32 ](name='AvailableShardNumbers', description='The number of desired shards, excluding the number of current shards.'),
  requestId?: string(name='RequestId', description='The request ID.', example='CBE843D8-964D-5EA3-9D31-822125611B6E'),
  shardNumber?: int32(name='ShardNumber', description='The number of shards that you want to change during the data migration.', example='128'),
}

model DescribeDBClusterShardNumberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBClusterShardNumberResponseBody(name='body'),
}

/**
 * @summary Queries the number of shards in an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeDBClusterShardNumberRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBClusterShardNumberResponse
 */
async function describeDBClusterShardNumberWithOptions(request: DescribeDBClusterShardNumberRequest, runtime: Util.RuntimeOptions): DescribeDBClusterShardNumberResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBClusterShardNumber',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the number of shards in an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeDBClusterShardNumberRequest
 * @return DescribeDBClusterShardNumberResponse
 */
async function describeDBClusterShardNumber(request: DescribeDBClusterShardNumberRequest): DescribeDBClusterShardNumberResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBClusterShardNumberWithOptions(request, runtime);
}

model DescribeDBClusterSpaceSummaryRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='am-bp1u8c0mgfg58****'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeDBClusterSpaceSummaryResponseBody = {
  data?: {
    coldData?: {
      dataSize?: long(name='DataSize', description='The data size of table records. Unit: bytes.', example='1048576'),
      indexSize?: long(name='IndexSize', description='The data size of regular indexes. Unit: bytes.', example='1048576'),
      otherSize?: long(name='OtherSize', description='The other data size. Unit: bytes.', example='1048576'),
      primaryKeyIndexSize?: long(name='PrimaryKeyIndexSize', description='The data size of primary key indexes. Unit: bytes.', example='1048576'),
      totalSize?: long(name='TotalSize', description='The cold data size. Unit: bytes.

>  Formula: Cold data size = Data size of table records + Data size of regular indexes + Data size of primary key indexes + Other data size.', example='4194304'),
    }(name='ColdData', description='The cold data.'),
    dataGrowth?: {
      dayGrowth?: long(name='DayGrowth', description='The data growth within the last day. Unit: bytes.

>  Formula: Data growth within the last day = Current data size - Data size of one day ago.', example='1048576'),
      weekGrowth?: long(name='WeekGrowth', description='The daily data growth within the last seven days. Unit: bytes.

>  Formula: Daily data growth within the last seven days = (Current data size - Data size of seven days ago)/7.', example='1048576'),
    }(name='DataGrowth', description='The data growth.'),
    hotData?: {
      dataSize?: long(name='DataSize', description='The data size of table records. Unit: bytes.', example='1048576'),
      indexSize?: long(name='IndexSize', description='The data size of regular indexes. Unit: bytes.', example='1048576'),
      otherSize?: long(name='OtherSize', description='The other data size. Unit: bytes.', example='1048576'),
      primaryKeyIndexSize?: long(name='PrimaryKeyIndexSize', description='The data size of primary key indexes. Unit: bytes.', example='1048576'),
      totalSize?: long(name='TotalSize', description='The hot data size. Unit: bytes.

>  Formula: Hot data size = Data size of table records + Data size of regular indexes + Data size of primary key indexes + Other data size.', example='4194304'),
    }(name='HotData', description='The hot data.'),
    totalSize?: string(name='TotalSize', description='The total data size. Unit: bytes.

>  Formula: Total data size = Hot data size+ Cold data size.', example='8388608'),
  }(name='Data', description='The queried storage overview information.'),
  requestId?: string(name='RequestId', description='The request ID.', example='25B56BC7-4978-40B3-9E48-4B7067******'),
}

model DescribeDBClusterSpaceSummaryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBClusterSpaceSummaryResponseBody(name='body'),
}

/**
 * @summary Queries the storage overview information of an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster, such as the total data size, hot data size, cold data size, and data growth.
 *
 * @param request DescribeDBClusterSpaceSummaryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBClusterSpaceSummaryResponse
 */
async function describeDBClusterSpaceSummaryWithOptions(request: DescribeDBClusterSpaceSummaryRequest, runtime: Util.RuntimeOptions): DescribeDBClusterSpaceSummaryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBClusterSpaceSummary',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the storage overview information of an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster, such as the total data size, hot data size, cold data size, and data growth.
 *
 * @param request DescribeDBClusterSpaceSummaryRequest
 * @return DescribeDBClusterSpaceSummaryResponse
 */
async function describeDBClusterSpaceSummary(request: DescribeDBClusterSpaceSummaryRequest): DescribeDBClusterSpaceSummaryResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBClusterSpaceSummaryWithOptions(request, runtime);
}

model DescribeDBClusterStatusRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeDBClusterStatusResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEAU'),
  status?: [ string ](name='Status', description='The status of clusters.'),
}

model DescribeDBClusterStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBClusterStatusResponseBody(name='body'),
}

/**
 * @summary Queries the status of AnalyticDB for MySQL Data Warehouse Edition clusters within a region.
 *
 * @param request DescribeDBClusterStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBClusterStatusResponse
 */
async function describeDBClusterStatusWithOptions(request: DescribeDBClusterStatusRequest, runtime: Util.RuntimeOptions): DescribeDBClusterStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBClusterStatus',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the status of AnalyticDB for MySQL Data Warehouse Edition clusters within a region.
 *
 * @param request DescribeDBClusterStatusRequest
 * @return DescribeDBClusterStatusResponse
 */
async function describeDBClusterStatus(request: DescribeDBClusterStatusRequest): DescribeDBClusterStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBClusterStatusWithOptions(request, runtime);
}

model DescribeDBClustersRequest {
  DBClusterDescription?: string(name='DBClusterDescription', description='The description of the cluster.

*   The description cannot start with `http://` or `https://`.
*   The description must be 2 to 256 characters in length', example='test'),
  DBClusterIds?: string(name='DBClusterIds', description='The cluster IDs.

> You can specify the ID of one cluster or IDs of more clusters within the preceding region.', example='am-bp1r053byu48p****'),
  DBClusterStatus?: string(name='DBClusterStatus', description='The state of the cluster. Valid values:

*   **Preparing**: The cluster is being prepared.
*   **Creating**: The cluster is being created.
*   **Restoring**: The cluster is being restored from a backup.
*   **Running**: The cluster is running.
*   **Deleting**: The cluster is being deleted.
*   **ClassChanging**: The cluster specifications are being changed.
*   **NetAddressCreating**: A network connection is being created.
*   **NetAddressDeleting**: A network connection is being deleted.', example='Running'),
  DBVersion?: string(name='DBVersion', description='The version of the cluster. Set the value to **3.0**.', example='3.0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the clusters.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-4690g37929XXXX'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of tag N that is added to the cluster. You can use tags to filter clusters. A tag is a key-value pair. You can specify up to 20 tags in one request. The letter N specifies the sequence number of each key-value pair and must be unique. The values of N must be consecutive integers that start from 1. Each value of `Tag.N.Key` is paired with a value of `Tag.N.Value`.

> The tag key can be up to 64 characters in length and cannot start with `aliyun`, `acs:`, `http://`, or `https://`.', example='tag1'),
      value?: string(name='Value', description='The value of tag N that is added to the cluster. You can use tags to filter clusters. A tag is a key-value pair. You can specify up to 20 tags in one request. The letter N specifies the sequence number of each key-value pair and must be unique. The values of N must be consecutive integers that start from 1. Each value of `Tag.N.Key` is paired with a value of `Tag.N.Value`.

> The tag key can be up to 64 characters in length and cannot start with `aliyun`, `acs:`, `http://`, or `https://`.', example='test1'),
    }
  ](name='Tag', description='The tags that are added to the cluster.'),
}

model DescribeDBClustersResponseBody = {
  items?: {
    DBCluster?: [ 
    {
      category?: string(name='Category', description='The edition of the cluster. Valid values:

*   **BASIC**: reserved mode for Basic Edition.
*   **CLUSTER**: reserved mode for Cluster Edition.
*   **MIXED_STORAGE**: elastic mode for Cluster Edition.

>  For more information about cluster editions, see [Editions](https://help.aliyun.com/document_detail/205001.html).', example='MIXED_STORAGE'),
      commodityCode?: string(name='CommodityCode', description='The commodity code. **ads** is returned.', example='ads'),
      computeResource?: string(name='ComputeResource', description='The specifications of computing resources that are used in the cluster in elastic mode. Computing resources are used to compute data. The increase in the computing resources can accelerate queries. You can scale computing resources based on your business requirements.', example='8Core32GB'),
      connectionString?: string(name='ConnectionString', description='The public endpoint that is used to connect to the cluster.', example='am-bp163885f8q21****.ads.aliyuncs.com'),
      createTime?: string(name='CreateTime', description='The time when the cluster was created. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time is displayed in UTC. Example: *2021-04-01T09:50:18Z*.', example='2021-04-01T09:50:18Z'),
      DBClusterDescription?: string(name='DBClusterDescription', description='The description of the cluster.', example='adb_test'),
      DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-bp163885f8q21****'),
      DBClusterNetworkType?: string(name='DBClusterNetworkType', description='The network type of the cluster. **VPC** is returned.', example='vpc'),
      DBClusterStatus?: string(name='DBClusterStatus', description='The status of the cluster. For more information, see [Cluster states](https://help.aliyun.com/document_detail/143075.html).', example='Running'),
      DBClusterType?: string(name='DBClusterType', description='The type of the cluster. Valid values:

*   **Common**: common cluster.
*   **RDS_ANALYSIS**: MySQL analytic instance.', example='Common'),
      DBNodeClass?: string(name='DBNodeClass', description='The specifications of the cluster.', example='E8'),
      DBNodeCount?: long(name='DBNodeCount', description='The number of node groups.', example='1'),
      DBNodeStorage?: long(name='DBNodeStorage', description='The storage capacity of the cluster. Unit: GB.', example='300'),
      DBVersion?: string(name='DBVersion', description='The version of the database engine. **3.0** is returned.', example='3.0'),
      diskType?: string(name='DiskType', description='The disk type of the cluster. Valid values:

*   **local_ssd**: local SSD.
*   **cloud**: basic disk.
*   **cloud_ssd**: standard SSD.
*   **cloud_efficiency**: ultra disk.
*   **cloud_essd0**: PL0 Enterprise SSD (ESSD).
*   **cloud_essd**: PL1 ESSD.
*   **cloud_essd2**: PL2 ESSD.
*   **cloud_essd3**: PL3 ESSD.

>  For more information about ESSDs, see [ESSDs](https://help.aliyun.com/document_detail/122389.html).', example='cloud_essd'),
      dtsJobId?: string(name='DtsJobId', description='The ID of the Data Transmission Service (DTS) synchronization job. This parameter is returned only for MySQL analytic instances.', example='dtsb1578j90XXXX'),
      elasticIOResource?: int32(name='ElasticIOResource', description='The number of elastic I/O units (EIUs). For more information, see [Elasticity of the storage layer](https://help.aliyun.com/document_detail/189505.html).

>  This parameter is returned only for clusters in elastic mode.', example='0'),
      engine?: string(name='Engine', description='The engine of the cluster. **AnalyticDB** is returned.', example='AnalyticDB'),
      executorCount?: string(name='ExecutorCount', description='The number of compute nodes that are used by the cluster in elastic mode.', example='1'),
      expireTime?: string(name='ExpireTime', description='The expiration time of the cluster. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time is displayed in UTC. Example: *2999-09-08T16:00:00Z*.

> 

*   If the billing method of the cluster is subscription, the actual expiration time is returned.

*   If the billing method of the cluster is pay-as-you-go, **2999-09-08T16:00:00Z** is returned.', example='2999-09-08T16:00:00Z'),
      expired?: string(name='Expired', description='Indicates whether the cluster has expired. Valid values:

*   **true**
*   **false**', example='false'),
      innerIp?: string(name='InnerIp', description='The public IP address of the cluster.', example='10.1.xx.xx'),
      innerPort?: string(name='InnerPort', description='The port number that is used to connect to the cluster.', example='3306'),
      lockMode?: string(name='LockMode', description='The lock mode of the cluster. Valid values:

*   **Unlock**: The cluster is not locked.
*   **ManualLock**: The cluster is manually locked.
*   **LockByExpiration**: The cluster is automatically locked due to cluster expiration.
*   **LockByRestoration**: The cluster is automatically locked due to cluster restoration.
*   **LockByDiskQuota**: The cluster is automatically locked when 90% of the cluster storage is used.', example='Unlock'),
      lockReason?: string(name='LockReason', description='The reason why the cluster is locked.

>  This parameter is returned only when the cluster was locked. **instance_expire** is returned.', example='instance_expired'),
      mode?: string(name='Mode', description='The mode of the cluster. Valid values:

*   **flexible**: elastic mode.
*   **reserver**: reserved mode.

> 

*   For more information about cluster modes, see [Editions](https://help.aliyun.com/document_detail/205001.html).', example='flexible'),
      payType?: string(name='PayType', description='The billing method of the cluster. Valid values:

*   **Postpaid**: pay-as-you-go.
*   **Prepaid**: subscription.', example='Postpaid'),
      port?: string(name='Port', description='The port number that is used to connect to the cluster. Default value: 3306.', example='3306'),
      productVersion?: string(name='ProductVersion', description='The edition of the cluster. Valid values:

*   **BasicVersion**: Basic Edition.
*   **EnterpriseVersion**: Enterprise Edition.', example='EnterpriseVersion'),
      rdsInstanceId?: string(name='RdsInstanceId', description='The ID of the ApsaraDB RDS instance from which data is synchronized to the cluster. This parameter is returned only for MySQL analytic instances.', example='rm-bp11q28kvl688****'),
      regionId?: string(name='RegionId', description='The region ID of the cluster.', example='cn-hangzhou'),
      resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfmyiu4ekp****'),
      storageResource?: string(name='StorageResource', description='The specifications of storage resources that are used in the cluster in elastic mode. Storage resources are used to read and write data. The increase in the storage resources can improve the read and write performance of the cluster.', example='8Core32GB'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key', description='The tag key.

>  You can call the [TagResources](https://help.aliyun.com/document_detail/179253.html) operation to add a tag to the cluster.', example='tag1'),
          value?: string(name='Value', description='The tag value.', example='test1'),
        }
      ](name='Tag')
      }(name='Tags', description='The tags that are added to the cluster.'),
      taskInfo?: {
        name?: string(name='Name', description='The name of the job.', example='analyticDBFlexibleScaleOut'),
        progress?: string(name='Progress', description='The progress of the job. Unit: %.', example='10'),
        status?: string(name='Status', description='The status of the job. Valid values:

*   **NOT_RUN**
*   **RUNNING**
*   **SUCCEED**', example='RUNNING'),
        stepList?: {
          stepList?: [ 
          {
            endTime?: string(name='EndTime', description='The end time of the job step. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.', example='2024-03-10T10:28:34Z'),
            startTime?: string(name='StartTime', description='The start time of the job step. The time follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.', example='2024-03-10T09:28:34Z'),
            stepDesc?: string(name='StepDesc', description='The description of the job step.', example='Apply resource'),
            stepName?: string(name='StepName', description='The name of the job step.', example='ApplyResource'),
            stepProgress?: string(name='StepProgress', description='The progress of the job step. Unit: %.', example='50'),
            stepStatus?: string(name='StepStatus', description='The status of the job step. Valid values:

*   **NOT_RUN**
*   **RUNNING**
*   **SUCCEED**', example='SUCCEED'),
          }
        ](name='StepList')
        }(name='StepList', description='The job step.'),
      }(name='TaskInfo', description='The job progress.'),
      VPCCloudInstanceId?: string(name='VPCCloudInstanceId', description='The ID of the cluster that resides in the VPC.', example='am-bp163885f8q21****-controller'),
      VPCId?: string(name='VPCId', description='The virtual private cloud (VPC) ID of the cluster.', example='vpc-bp13h7uzhulpuxvnpXXXX'),
      vSwitchId?: string(name='VSwitchId', description='The vSwitch ID of the cluster.', example='vsw-bp1syh8vvw8yech7nXXXX'),
      zoneId?: string(name='ZoneId', description='The zone ID of the cluster.', example='cn-hangzhou-h'),
    }
  ](name='DBCluster')
  }(name='Items', description='The queried cluster information.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='D65A809F-34CE-4550-9BC1-0ED21ETG380'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model DescribeDBClustersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBClustersResponseBody(name='body'),
}

/**
 * @summary Queries a list of AnalyticDB for MySQL clusters within a region.
 *
 * @param request DescribeDBClustersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBClustersResponse
 */
async function describeDBClustersWithOptions(request: DescribeDBClustersRequest, runtime: Util.RuntimeOptions): DescribeDBClustersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterDescription)) {
    query['DBClusterDescription'] = request.DBClusterDescription;
  }
  if (!Util.isUnset(request.DBClusterIds)) {
    query['DBClusterIds'] = request.DBClusterIds;
  }
  if (!Util.isUnset(request.DBClusterStatus)) {
    query['DBClusterStatus'] = request.DBClusterStatus;
  }
  if (!Util.isUnset(request.DBVersion)) {
    query['DBVersion'] = request.DBVersion;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBClusters',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of AnalyticDB for MySQL clusters within a region.
 *
 * @param request DescribeDBClustersRequest
 * @return DescribeDBClustersResponse
 */
async function describeDBClusters(request: DescribeDBClustersRequest): DescribeDBClustersResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBClustersWithOptions(request, runtime);
}

model DescribeDBResourceGroupRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='am-bp1ub9grke1****'),
  groupName?: string(name='GroupName', description='The name of the resource group.', example='USER_DEFAULT'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeDBResourceGroupResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-bp1ub9grke1****'),
  groupsInfo?: [ 
    {
      createTime?: string(name='CreateTime', description='The time when the resource group was created.', example='2022-10-09 16:57:35.241'),
      groupName?: string(name='GroupName', description='The name of the resource group.', example='USER_DEFAULT'),
      groupType?: string(name='GroupType', description='The query execution mode. Valid values:

*   **interactive**
*   **batch** (default)

> For more information, see [Query execution modes](https://help.aliyun.com/document_detail/189502.html).', example='interactive'),
      groupUserList?: [ string ](name='GroupUserList', description='The database accounts that are associated with the resource group.'),
      groupUsers?: string(name='GroupUsers', description='The database accounts that are associated with the resource group. Multiple database accounts are separated by commas (,).', example='testb,testc'),
      nodeNum?: int32(name='NodeNum', description='The number of nodes. Each node provides 16 cores and 64 GB memory.', example='2'),
      updateTime?: string(name='UpdateTime', description='The time when the resource group was updated.', example='2022-11-09 16:57:35.241'),
    }
  ](name='GroupsInfo', description='The queried resource groups.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeDBResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBResourceGroupResponseBody(name='body'),
}

/**
 * @summary Queries the information about a resource group for an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.
 *
 * @description ###
 * You can call this operation only for AnalyticDB for MySQL clusters in elastic mode for Cluster Edition that have 32 cores or more.
 *
 * @param request DescribeDBResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBResourceGroupResponse
 */
async function describeDBResourceGroupWithOptions(request: DescribeDBResourceGroupRequest, runtime: Util.RuntimeOptions): DescribeDBResourceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBResourceGroup',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a resource group for an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.
 *
 * @description ###
 * You can call this operation only for AnalyticDB for MySQL clusters in elastic mode for Cluster Edition that have 32 cores or more.
 *
 * @param request DescribeDBResourceGroupRequest
 * @return DescribeDBResourceGroupResponse
 */
async function describeDBResourceGroup(request: DescribeDBResourceGroupRequest): DescribeDBResourceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBResourceGroupWithOptions(request, runtime);
}

model DescribeDBResourcePoolRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a specific region.

This parameter is required.', example='am-bp11q28kvl688****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  poolName?: string(name='PoolName', description='The name of the resource group.', example='USER_DEFAULT'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeDBResourcePoolResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.', example='am-bp11q28kvl688****'),
  poolsInfo?: [ 
    {
      createTime?: string(name='CreateTime', description='The time when the resource group was created.', example='2022-03-09 16:57:35.241'),
      nodeNum?: int32(name='NodeNum', description='The number of nodes.

>  Each node consumes 16 cores and 64 GB memory.', example='2'),
      poolName?: string(name='PoolName', description='The name of the resource group.', example='USER_DEFAULT'),
      poolUsers?: string(name='PoolUsers', description='The database accounts that are associated with the resource group.', example='testb,testc'),
      queryType?: string(name='QueryType', description='The mode in which SQL statements are executed.

*   **batch**
*   **interactive**

>  For more information, see [Query execution modes](https://help.aliyun.com/document_detail/189502.html).', example='default_type'),
      updateTime?: string(name='UpdateTime', description='The time when the resource group was updated.', example='2022-03-09 16:57:35.241'),
    }
  ](name='PoolsInfo', description='Details of the resource group.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeDBResourcePoolResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBResourcePoolResponseBody(name='body'),
}

/**
 * @summary 查询资源组详情
 *
 * @description This operation is applicable only for elastic clusters of 32 cores or more.
 *
 * @param request DescribeDBResourcePoolRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBResourcePoolResponse
 */
async function describeDBResourcePoolWithOptions(request: DescribeDBResourcePoolRequest, runtime: Util.RuntimeOptions): DescribeDBResourcePoolResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.poolName)) {
    query['PoolName'] = request.poolName;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBResourcePool',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询资源组详情
 *
 * @description This operation is applicable only for elastic clusters of 32 cores or more.
 *
 * @param request DescribeDBResourcePoolRequest
 * @return DescribeDBResourcePoolResponse
 */
async function describeDBResourcePool(request: DescribeDBResourcePoolRequest): DescribeDBResourcePoolResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBResourcePoolWithOptions(request, runtime);
}

model DescribeDiagnosisDimensionsRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='am-bt6u59zcmd945****'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

> 

*   The end time must be later than the start time.

*   The maximum time range that can be specified is 24 hours.

This parameter is required.', example='1625220213000'),
  lang?: string(name='Lang', description='The language of file titles and error messages. Valid values:

*   **zh** (default): simplified Chinese.
*   **en**: English.
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  queryCondition?: string(name='QueryCondition', description='The query condition for SQL statements, which can be a combination of the `Type` and `Value` fields or a combination of the Type, `Min`, and `Max` fields. Specify the conditions in the JSON format. `Type` specifies the query dimension. Valid values for Type: `maxCost`, `status`, and `cost`. `Value`, `Min`, or `Max` specifies the query range for the dimension. Valid values:

*   `{"Type":"maxCost","Value":"100"}`: queries the top 100 most time-consuming SQL statements. Set `Value` to 100.
*   `{"Type":"status","Value":"finished"}`: queries the executed SQL statements, **including successful and failed SQL statements**. You can set `Value` to `running` to query the SQL statements that are being executed. You can also set Value to `failed` to query the SQL statements that failed to be executed.
*   `{"Type":"cost","Min":"10","Max":"200"}`: queries the SQL statements whose execution duration is in the range of 10 to 200 milliseconds. You can also specify custom values for the Min and Max fields.

This parameter is required.', example='{"Type":"maxCost","Value":"100"}'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

> Only data within the last 14 days can be queried. If you call this operation to query data that is earlier than 14 days, an empty string is returned.

This parameter is required.', example='1625220210000'),
}

model DescribeDiagnosisDimensionsResponseBody = {
  clientIps?: [ string ](name='ClientIps', description='The source IP addresses.'),
  databases?: [ string ](name='Databases', description='The databases.'),
  requestId?: string(name='RequestId', description='The request ID.', example='E0B56BCD-1BED-30EC-8CAF-1D1E5F******'),
  resourceGroups?: [ string ](name='ResourceGroups', description='The resource groups.'),
  userNames?: [ string ](name='UserNames', description='The usernames.'),
}

model DescribeDiagnosisDimensionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDiagnosisDimensionsResponseBody(name='body'),
}

/**
 * @summary Queries the deduplicated statistics of SQL statements that meet a condition of the resource group, database, username, and source IP address in an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeDiagnosisDimensionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDiagnosisDimensionsResponse
 */
async function describeDiagnosisDimensionsWithOptions(request: DescribeDiagnosisDimensionsRequest, runtime: Util.RuntimeOptions): DescribeDiagnosisDimensionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.queryCondition)) {
    query['QueryCondition'] = request.queryCondition;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDiagnosisDimensions',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the deduplicated statistics of SQL statements that meet a condition of the resource group, database, username, and source IP address in an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeDiagnosisDimensionsRequest
 * @return DescribeDiagnosisDimensionsResponse
 */
async function describeDiagnosisDimensions(request: DescribeDiagnosisDimensionsRequest): DescribeDiagnosisDimensionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDiagnosisDimensionsWithOptions(request, runtime);
}

model DescribeDiagnosisMonitorPerformanceRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the cluster IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='am-bp108q1py5r78****'),
  endTime?: string(name='EndTime', description='The end of the time range to query. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1671687948000'),
  lang?: string(name='Lang', description='The language of file titles and error messages. Valid values:

*   **zh** (default): simplified Chinese.
*   **en**: English.
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  queryCondition?: string(name='QueryCondition', description='The query conditions for SQL statements, which can be a combination of the `Type` and `Value` fields or a combination of the Type, `Min`, and `Max` fields. Specify the conditions in the JSON format. `Type` specifies the query dimension. Valid values for Type: `maxCost`, `status`, and `cost`. `Value`, `Min`, or `Max` specifies the query range for the dimension. Valid values:

*   `{"Type":"maxCost","Value":"100"}`: queries the top 100 most time-consuming SQL statements. Set `Value` to 100.
*   `{"Type":"status","Value":"finished"}`: queries the executed SQL statements, **including successful and failed SQL statements**. You can set `Value` to `running` to query the SQL statements that are being executed. You can also set Value to `failed` to query the SQL statements that failed to be executed.
*   `{"Type":"cost","Min":"10","Max":"200"}`: queries the SQL statements whose execution duration is in the range of 10 to 200 milliseconds. You can also specify custom values for the Min and Max fields.

This parameter is required.', example='{\\\\"Type\\\\":\\\\"maxCost\\\\",\\\\"Value\\\\":\\\\"100\\\\"}'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-beijing'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1671684348000'),
}

model DescribeDiagnosisMonitorPerformanceResponseBody = {
  performances?: [ 
    {
      cost?: long(name='Cost', description='The total execution duration. Unit: milliseconds.

>  This value is the cumulative value of the `QueuedTime`, `TotalPlanningTime`, and `ExecutionTime` parameters.', example='252'),
      peakMemory?: long(name='PeakMemory', description='The peak memory of the query. Unit: bytes.', example='123'),
      processId?: string(name='ProcessId', description='The query ID.', example='202210311015270330101470300315153****'),
      rcHost?: string(name='RcHost', description='The IP address of the AnalyticDB for MySQL frontend node on which the SQL statement is executed.', example='192.168.XX.XX'),
      scanRows?: long(name='ScanRows', description='The number of rows scanned.', example='2345'),
      scanSize?: long(name='ScanSize', description='The amount of scanned data. Unit: bytes.', example='123'),
      startTime?: long(name='StartTime', description='The execution start time of the SQL statement. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1669011260000'),
      status?: string(name='Status', description='The status of the SQL statement. Valid values:

*   **running**
*   **finished**
*   **failed**', example='running'),
      userName?: string(name='UserName', description='The database account that is used to submit the query.', example='rpt'),
    }
  ](name='Performances', description='The monitoring information about queries displayed in Gantt charts.'),
  performancesThreshold?: int32(name='PerformancesThreshold', description='The threshold for the number of queries displayed in a Gantt chart. Default value: 10000.

>  Up to 10,000 queries can be displayed in a Gantt chart even if more queries exist.', example='10000'),
  performancesTruncated?: boolean(name='PerformancesTruncated', description='Indicates whether all queries are returned. Valid values:

*   true
*   false', example='false'),
  requestId?: string(name='RequestId', description='The request ID.', example='0F1AC5FD-16E9-5399-B81F-5AC434B1D9F8'),
}

model DescribeDiagnosisMonitorPerformanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDiagnosisMonitorPerformanceResponseBody(name='body'),
}

/**
 * @summary Queries the monitoring information about queries within a time range.
 *
 * @param request DescribeDiagnosisMonitorPerformanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDiagnosisMonitorPerformanceResponse
 */
async function describeDiagnosisMonitorPerformanceWithOptions(request: DescribeDiagnosisMonitorPerformanceRequest, runtime: Util.RuntimeOptions): DescribeDiagnosisMonitorPerformanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.queryCondition)) {
    query['QueryCondition'] = request.queryCondition;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDiagnosisMonitorPerformance',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the monitoring information about queries within a time range.
 *
 * @param request DescribeDiagnosisMonitorPerformanceRequest
 * @return DescribeDiagnosisMonitorPerformanceResponse
 */
async function describeDiagnosisMonitorPerformance(request: DescribeDiagnosisMonitorPerformanceRequest): DescribeDiagnosisMonitorPerformanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDiagnosisMonitorPerformanceWithOptions(request, runtime);
}

model DescribeDiagnosisRecordsRequest {
  clientIp?: string(name='ClientIp', description='The source IP address.

> You can call the [DescribeDiagnosisDimensions](https://help.aliyun.com/document_detail/308210.html) operation to query the resource group, database name, username, and source IP address of the SQL statements to be queried.', example='59.82.xx.xx'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-bp1r053byu48p****'),
  database?: string(name='Database', description='The database on which the SQL statements are executed.

> You can call the [DescribeDiagnosisDimensions](https://help.aliyun.com/document_detail/308210.html) operation to query the resource group, database name, username, and source IP address of the SQL statements to be queried.', example='adb_demo'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

> 

*   The end time must be later than the start time.

*   The maximum time range that can be specified is 24 hours.

This parameter is required.', example='1633017540000'),
  keyword?: string(name='Keyword', description='The keyword for the query.', example='select'),
  lang?: string(name='Lang', description='The language of file titles and error messages. Valid values:

*   **zh** (default): simplified Chinese.
*   **en**: English.
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  maxPeakMemory?: long(name='MaxPeakMemory', description='The maximum peak memory of the SQL statements. Unit: bytes.', example='89000000'),
  maxScanSize?: long(name='MaxScanSize', description='The maximum scan size of the SQL statements. Unit: bytes.', example='104428198'),
  minPeakMemory?: long(name='MinPeakMemory', description='The minimum peak memory of the SQL statements. Unit: bytes.', example='0'),
  minScanSize?: long(name='MinScanSize', description='The minimum scan size of the SQL statements. Unit: bytes.', example='0'),
  order?: string(name='Order', description='The order in which to sort the retrieved SQL statements by field. Specify this value in the JSON format. The value is an ordered array that uses the order of the input array and contains the `Field` and `Type` fields. Example: `[{"Field":"StartTime", "Type": "desc" }]`. Fields:

*   `Field` specifies the field that is used to sort the retrieved SQL statements. Valid values:

    *   `StartTime`: the start time of the execution.
    *   `Status`: the execution state.
    *   `UserName`: the username.
    *   `Cost`: the execution duration.
    *   `PeakMemory`: the peak memory.
    *   `ScanSize`: the amount of data to be scanned.
    *   `Database`: the name of the database.
    *   `ClientIp`: the source IP address.
    *   `ResourceGroup`: the name of the resource group.
    *   `QueueTime`: the amount of time that is consumed for queuing.
    *   `OutputRows`: the number of output rows.
    *   `OutputDataSize`: the amount of output data.
    *   `ResourceCostRank`: the execution duration rank of operators that are used in the SQL statements. This field takes effect only when `QueryCondition` is set to `{"Type":"status","Value":"running"}`.

*   `Type` specifies the sorting order. Valid values (case-insensitive):

    *   `Desc`: descending order.
    *   `Asc`: ascending order.', example='[{"Field":"StartTime", "Type": "desc" }]'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: **30**, **50**, and **100**. Default value: 30.', example='30'),
  patternId?: string(name='PatternId', description='The SQL pattern ID.

>  You can call the [DescribeSQLPatterns](https://help.aliyun.com/document_detail/321868.html) operation to query the information about all SQL patterns within an AnalyticDB for MySQL cluster in a time range, including SQL pattern IDs.', example='5575924945138******'),
  queryCondition?: string(name='QueryCondition', description='The query condition for SQL statements, which can contain the `Type`, `Value`, and `Min` or `Max` fields. Specify the condition in the JSON format. `Type` specifies the query dimension. Valid values for Type: `maxCost`, `status`, and `cost`. `Value`, `Min`, or `Max` specifies the query range for the dimension. Valid values:

*   `{"Type":"maxCost","Value":"100"}`: queries the top 100 most time-consuming SQL statements. Set `Value` to 100.
*   `{"Type":"status","Value":"finished"}`: queries executed SQL statements. You can set `Value` to `running` to query SQL statements that are being executed. You can also set Value to `failed` to query SQL statements that failed to be executed.
*   `{"Type":"cost","Min":"10","Max":"200"}`: queries SQL statements whose execution durations are in the range of 10 to 200 milliseconds. You can also customize the maximum and minimum execution durations.

This parameter is required.', example='{"Type":"status","Value":"finished"}'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceGroup?: string(name='ResourceGroup', description='The resource group to which the SQL statements belong.

> You can call the [DescribeDiagnosisDimensions](https://help.aliyun.com/document_detail/308210.html) operation to query the resource group, database name, username, and source IP address of the SQL statements to be queried.', example='user_default'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

> Only data within the last 14 days can be queried.

This parameter is required.', example='1632931200000'),
  userName?: string(name='UserName', description='The username that is used to execute the SQL statements.

> You can call the [DescribeDiagnosisDimensions](https://help.aliyun.com/document_detail/308210.html) operation to query the resource group, database name, username, and source IP address of the SQL statements to be queried.', example='test_user'),
}

model DescribeDiagnosisRecordsResponseBody = {
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='30'),
  querys?: [ 
    {
      clientIp?: string(name='ClientIp', description='The source IP address.', example='59.82.xx.xx'),
      cost?: long(name='Cost', description='The total execution duration. Unit: milliseconds.

>  This value is the cumulative value of the `QueuedTime`, `TotalPlanningTime`, and `ExecutionTime` parameters.', example='10'),
      database?: string(name='Database', description='The name of the database on which the SQL statement is executed.', example='adb_demo'),
      etlWriteRows?: long(name='EtlWriteRows', description='The number of rows written to the table by an extract, transform, and load (ETL) task.', example='0'),
      executionTime?: long(name='ExecutionTime', description='The execution duration. Unit: milliseconds.', example='6'),
      outputDataSize?: long(name='OutputDataSize', description='The amount of returned data. Unit: bytes.', example='9'),
      outputRows?: long(name='OutputRows', description='The number of rows returned.', example='1'),
      patternId?: string(name='PatternId', description='The SQL pattern ID.

>  You can call the [DescribePatternPerformance](https://help.aliyun.com/document_detail/612503.html) operation to query the performance metrics of an SQL pattern within a time range.', example='-5575924945138******'),
      peakMemory?: long(name='PeakMemory', description='The peak memory. Unit: bytes.', example='16648'),
      processId?: string(name='ProcessId', description='The query ID.', example='2021093000414401000000023503151******'),
      queryProperties?: [ 
        {
          name?: string(name='Name', description='The name of the query property.', example='ff'),
          value?: string(name='Value', description='The value of the query property.', example='40'),
        }
      ](name='QueryProperties', description='The query properties.'),
      queueTime?: long(name='QueueTime', description='The amount of time that is consumed for queuing. Unit: milliseconds.', example='0'),
      rcHost?: string(name='RcHost', description='The IP address and port number of the AnalyticDB for MySQL frontend node on which the SQL statement is executed.', example='10.0.xx.xx:3004'),
      resourceCostRank?: int32(name='ResourceCostRank', description='The execution duration rank of operators that are used in the SQL statement.

> This field is returned only for SQL statements that have the `Status` parameter set to `running`.', example='1'),
      resourceGroup?: string(name='ResourceGroup', description='The resource group to which the SQL statement belongs.', example='user_default'),
      SQL?: string(name='SQL', description='The SQL statement.

> For performance considerations, an SQL statement cannot exceed 5,120 characters in length. Otherwise, the SQL statement is truncated. You can call the [DownloadDiagnosisRecords](https://help.aliyun.com/document_detail/308212.html) operation to download the diagnostic information about SQL statements that meet a condition in an AnalyticDB for MySQL cluster, including the complete SQL statements.', example='SELECT count(*)\\\\nFROM nation'),
      SQLTruncated?: boolean(name='SQLTruncated', description='Indicates whether the SQL statement is truncated. Valid values:

*   **true**
*   **false**', example='false'),
      SQLTruncatedThreshold?: long(name='SQLTruncatedThreshold', description='The maximum length of the SQL statement. 5120 is returned. Unit: character. SQL statements that exceed this limit are truncated.', example='5120'),
      scanRows?: long(name='ScanRows', description='The number of entries scanned.', example='1'),
      scanSize?: long(name='ScanSize', description='The amount of scanned data. Unit: bytes.', example='9'),
      startTime?: long(name='StartTime', description='The beginning of the time range in which the SQL statement is executed. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1632933704000'),
      status?: string(name='Status', description='The state of the SQL statement. Valid values:

*   **running**
*   **finished**
*   **failed**', example='finished'),
      totalPlanningTime?: long(name='TotalPlanningTime', description='The amount of time that is consumed to generate an execution plan. Unit: milliseconds.', example='4'),
      totalStages?: int32(name='TotalStages', description='The total number of stages generated.', example='2'),
      userName?: string(name='UserName', description='The username that is used to execute the SQL statement.', example='test_user'),
    }
  ](name='Querys', description='The queried SQL statements.'),
  requestId?: string(name='RequestId', description='The request ID.', example='109462AF-B5FA-3D5A-9377-B27E5B******'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model DescribeDiagnosisRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDiagnosisRecordsResponseBody(name='body'),
}

/**
 * @summary Queries the diagnostic information about SQL statements that meet a condition in an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeDiagnosisRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDiagnosisRecordsResponse
 */
async function describeDiagnosisRecordsWithOptions(request: DescribeDiagnosisRecordsRequest, runtime: Util.RuntimeOptions): DescribeDiagnosisRecordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientIp)) {
    query['ClientIp'] = request.clientIp;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.database)) {
    query['Database'] = request.database;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.maxPeakMemory)) {
    query['MaxPeakMemory'] = request.maxPeakMemory;
  }
  if (!Util.isUnset(request.maxScanSize)) {
    query['MaxScanSize'] = request.maxScanSize;
  }
  if (!Util.isUnset(request.minPeakMemory)) {
    query['MinPeakMemory'] = request.minPeakMemory;
  }
  if (!Util.isUnset(request.minScanSize)) {
    query['MinScanSize'] = request.minScanSize;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.patternId)) {
    query['PatternId'] = request.patternId;
  }
  if (!Util.isUnset(request.queryCondition)) {
    query['QueryCondition'] = request.queryCondition;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroup)) {
    query['ResourceGroup'] = request.resourceGroup;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDiagnosisRecords',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the diagnostic information about SQL statements that meet a condition in an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeDiagnosisRecordsRequest
 * @return DescribeDiagnosisRecordsResponse
 */
async function describeDiagnosisRecords(request: DescribeDiagnosisRecordsRequest): DescribeDiagnosisRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDiagnosisRecordsWithOptions(request, runtime);
}

model DescribeDiagnosisSQLInfoRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the cluster IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a specific region.

This parameter is required.', example='am-bp1r053byu48p****'),
  lang?: string(name='Lang', description='The language of file titles and error messages. Valid values:

*   **zh**: simplified Chinese
*   **en**: English
*   **ja**: Japanese
*   **zh-tw**: traditional Chinese

This parameter is required.', example='zh'),
  processId?: string(name='ProcessId', description='The ID of the query.

>  You can call the [DescribeDiagnosisRecords](https://help.aliyun.com/document_detail/308207.html) operation to query the SQL summary information of a specified AnalyticDB for MySQL cluster, including the query ID.

This parameter is required.', example='2021070216432217201616806503453******'),
  processRcHost?: string(name='ProcessRcHost', description='The IP address and port number of the AnalyticDB for MySQL frontend node on which the SQL statement is executed.

>  You can call the [DescribeDiagnosisRecords](https://help.aliyun.com/document_detail/308207.html) operation to query the SQL summary information of a specified AnalyticDB for MySQL cluster, including the IP address and port number of the frontend node.', example='192.45.***.***:3145'),
  processStartTime?: long(name='ProcessStartTime', description='The execution start time of the SQL statement. Specify the time in the UNIX timestamp format. Unit: milliseconds.

>  You can call the [DescribeDiagnosisRecords](https://help.aliyun.com/document_detail/308207.html) operation to query the SQL summary information of a specified AnalyticDB for MySQL cluster, including the execution start time of the SQL statement.', example='1625215402000'),
  processState?: string(name='ProcessState', description='The state of the SQL statement. Valid values:

*   **running**

*   **finished**

*   **failed**

> You can call the [DescribeDiagnosisRecords](https://help.aliyun.com/document_detail/308207.html) operation to query the SQL summary information of a specified AnalyticDB for MySQL cluster, including the state of the SQL statement.', example='running'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeDiagnosisSQLInfoResponseBody = {
  diagnosisSQLInfo?: string(name='DiagnosisSQLInfo', description='Execution details of the SQL statement, including the SQL statement text, statistics, execution plan, and operator information.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1'),
  stageInfos?: [ 
    {
      inputDataSize?: long(name='InputDataSize', description='The total amount of input data in the stage. Unit: bytes.', example='2341'),
      inputRows?: long(name='InputRows', description='The total number of input rows in the stage.', example='123'),
      operatorCost?: long(name='OperatorCost', description='The total amount of time consumed by all operators in the stage. Unit: milliseconds.', example='2341'),
      outputDataSize?: long(name='OutputDataSize', description='The total amount of output data in the stage. Unit: bytes.', example='12344'),
      outputRows?: long(name='OutputRows', description='The total number of output rows in the stage.', example='231'),
      peakMemory?: long(name='PeakMemory', description='The total peak memory of the stage. Unit: bytes.', example='3421'),
      progress?: double(name='Progress', description='The execution progress of the stage.', example='0.3'),
      stageId?: string(name='StageId', description='The ID of the stage.', example='Stage[26]'),
      state?: string(name='State', description='The state of the stage.', example='RUNNING'),
    }
  ](name='StageInfos', description='Execution details of the query by stage.'),
}

model DescribeDiagnosisSQLInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDiagnosisSQLInfoResponseBody(name='body'),
}

/**
 * @summary Queries the execution information about an SQL statement, including the execution plan, execution information, resource usage, and self-diagnostics results.
 *
 * @param request DescribeDiagnosisSQLInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDiagnosisSQLInfoResponse
 */
async function describeDiagnosisSQLInfoWithOptions(request: DescribeDiagnosisSQLInfoRequest, runtime: Util.RuntimeOptions): DescribeDiagnosisSQLInfoResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDiagnosisSQLInfo',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the execution information about an SQL statement, including the execution plan, execution information, resource usage, and self-diagnostics results.
 *
 * @param request DescribeDiagnosisSQLInfoRequest
 * @return DescribeDiagnosisSQLInfoResponse
 */
async function describeDiagnosisSQLInfo(request: DescribeDiagnosisSQLInfoRequest): DescribeDiagnosisSQLInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDiagnosisSQLInfoWithOptions(request, runtime);
}

model DescribeDiagnosisTasksRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='am-bp1r053byu48p****'),
  host?: string(name='Host', description='The IP address from which the query was initiated.', example='192.168.XX.XX'),
  order?: string(name='Order', description='The order in which to sort the tasks by field. Specify the value in the JSON format. Example: `[{"Field":"CreateTime", "Type":"desc"}]`.

> 

*   `Field` specifies the field that is used to sort the tasks. Valid values of Field: `State`, `CreateTime`, `DBName`, `ProcessID`, `UpdateTime`, `JobName`, and `ProcessRows`.

*   `Type` specifies the sort order. Valid values of Type: `Desc` and `Asc`. The values are case-insensitive.', example='[{"Field":"StartTime", "Type": "desc" }]'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   30 (default)
*   50
*   100', example='30'),
  processId?: string(name='ProcessId', description='The query ID.

> You can call the [DescribeProcessList](https://help.aliyun.com/document_detail/190092.html) operation to query the IDs of queries that are being executed.

This parameter is required.', example='202011191048151921681492420315100****'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.', example='cn-hangzhou'),
  stageId?: string(name='StageId', description='The ID of a stage in the query that is specified by the `ProcessId` parameter.

This parameter is required.', example='Stage[26]'),
  state?: string(name='State', description='The state of the asynchronous import or export task to be queried. Valid values:

*   **RUNNING**
*   **FINISHED**
*   **FAILED**', example='RUNNING'),
}

model DescribeDiagnosisTasksResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='F0983B43-B2EC-536A-8791-142B5CF1E9B6'),
  taskList?: [ 
    {
      computeTimeRatio?: string(name='ComputeTimeRatio', description='The compute time ratio, which can be used to determine whether the task is really time-consuming. This parameter can be calculated by using the following formula: OperatorCost/Drivers/ElapsedTime. A greater value indicates that the task was executed for computing for most of the task time. A less value indicates that the task was waiting for scheduling or blocked due to other reasons for most of the task time.', example='0.89'),
      drivers?: string(name='Drivers', description='The number of tasks that can be executed concurrently.', example='16'),
      elapsedTime?: long(name='ElapsedTime', description='The amount of time that elapsed from when the task was created to when the task was completed. Unit: milliseconds.', example='456'),
      inputDataSize?: long(name='InputDataSize', description='The amount of input data in the task. Unit: bytes.', example='123'),
      inputRows?: long(name='InputRows', description='The number of input rows in the task.', example='105'),
      operatorCost?: long(name='OperatorCost', description='The total amount of time that is consumed by all operators in the task on a node. This parameter can be used to determine whether long tails occur in computing. Unit: milliseconds.', example='3'),
      outputDataSize?: long(name='OutputDataSize', description='The amount of output data in the task. Unit: bytes.', example='123'),
      outputRows?: long(name='OutputRows', description='The number of output rows in the task.', example='105'),
      peakMemory?: long(name='PeakMemory', description='The peak memory of the task. Unit: bytes.', example='234'),
      queuedTime?: string(name='QueuedTime', description='The queuing duration of the task. Unit: milliseconds.', example='12'),
      scanCost?: long(name='ScanCost', description='The amount of time that is consumed to scan data from a data source in the task. Unit: milliseconds.', example='0'),
      scanDataSize?: long(name='ScanDataSize', description='The amount of scanned data in the task. Unit: bytes.', example='123'),
      scanRows?: long(name='ScanRows', description='The number of rows that are scanned from a data source in the task.', example='0'),
      state?: string(name='State', description='The final execution state of the task. Valid values:

*   FINISHED
*   CANCELED
*   ABORTED
*   FAILED', example='FINISHED'),
      taskCreateTime?: long(name='TaskCreateTime', description='The timestamp when the task was created.', example='2022-12-12 00:00:12'),
      taskEndTime?: long(name='TaskEndTime', description='The timestamp when the task ends.', example='2022-12-22 00:00:00'),
      taskHost?: string(name='TaskHost', description='The IP address of the host where the task was executed.', example='192.168.XX.XX'),
      taskId?: string(name='TaskId', description='The task ID.', example='22568****'),
    }
  ](name='TaskList', description='The queried tasks.'),
  totalCount?: int32(name='TotalCount', description='The total number of tasks in the stage.', example='33'),
}

model DescribeDiagnosisTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDiagnosisTasksResponseBody(name='body'),
}

/**
 * @summary Queries the execution information about distributed tasks in a stage of a query.
 *
 * @param request DescribeDiagnosisTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDiagnosisTasksResponse
 */
async function describeDiagnosisTasksWithOptions(request: DescribeDiagnosisTasksRequest, runtime: Util.RuntimeOptions): DescribeDiagnosisTasksResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDiagnosisTasks',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the execution information about distributed tasks in a stage of a query.
 *
 * @param request DescribeDiagnosisTasksRequest
 * @return DescribeDiagnosisTasksResponse
 */
async function describeDiagnosisTasks(request: DescribeDiagnosisTasksRequest): DescribeDiagnosisTasksResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDiagnosisTasksWithOptions(request, runtime);
}

model DescribeDownloadRecordsRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='am-****************'),
  lang?: string(name='Lang', description='The language of file titles and error messages. Valid values:

*   **zh** (default): simplified Chinese.
*   **en**: English.
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
}

model DescribeDownloadRecordsResponseBody = {
  records?: [ 
    {
      downloadId?: long(name='DownloadId', description='The download task ID.', example='69'),
      exceptionMsg?: string(name='ExceptionMsg', description='The error message returned if the download task failed.', example='The query result is empty.'),
      fileName?: string(name='FileName', description='The name of the downloaded file.', example='20210806094635-20210806095135'),
      status?: string(name='Status', description='The status of the download task. Valid values:

*   **running**
*   **finished**
*   **failed**', example='finished'),
      url?: string(name='Url', description='The download URL of the file.'),
    }
  ](name='Records', description='The queried download tasks.'),
  requestId?: string(name='RequestId', description='The request ID.', example='987F51BE-C4CB-332A-B159-63CE87******'),
}

model DescribeDownloadRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDownloadRecordsResponseBody(name='body'),
}

/**
 * @summary Queries a list of download tasks for the last five SQL queries of an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeDownloadRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDownloadRecordsResponse
 */
async function describeDownloadRecordsWithOptions(request: DescribeDownloadRecordsRequest, runtime: Util.RuntimeOptions): DescribeDownloadRecordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDownloadRecords',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of download tasks for the last five SQL queries of an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeDownloadRecordsRequest
 * @return DescribeDownloadRecordsResponse
 */
async function describeDownloadRecords(request: DescribeDownloadRecordsRequest): DescribeDownloadRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDownloadRecordsWithOptions(request, runtime);
}

model DescribeEIURangeRequest {
  computeResource?: string(name='ComputeResource', description='The specifications of computing resources.

>  You can call the [DescribeComputeResource](https://help.aliyun.com/document_detail/469002.html) operation to query the specifications of computing resources.', example='{
      "RealValue": "32Core128GBNEW",
      "DisplayValue": "32Core128GB"
    }'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

*   This parameter can be left empty when **Operation** is set to **Buy**.
*   This parameter must be specified when **Operation** is set to **Upgrade** or **Downgrade**.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.', example='am-bp16t5ci7r74s****'),
  DBClusterVersion?: string(name='DBClusterVersion', description='The version of the AnalyticDB for MySQL Data Warehouse Edition cluster. Set the value to **3.0**.', example='3.0'),
  operation?: string(name='Operation', description='The type of the operation. Valid values:

*   **Buy**: purchases a cluster.
*   **Modify**: changes configurations of a cluster.', example='Buy'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  productVersion?: string(name='ProductVersion'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-4690g37929****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  storageSize?: string(name='StorageSize', description='The specifications of storage resources. Default value: **8ACU**. Valid values:

*   **8ACU**
*   **12ACU**
*   **16ACU**', example='8ACU'),
  subOperation?: string(name='SubOperation', description='The type of the sub-operation. Valid values:

*   **Upgrade**: upgrades a cluster.
*   **Downgrade**: downgrades a cluster.', example='Upgrade'),
  zoneId?: string(name='ZoneId', description='The zone ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/612293.html) operation to query the most recent zone list.', example='cn-hangzhou-h'),
}

model DescribeEIURangeResponseBody = {
  EIUInfo?: {
    defaultValue?: string(name='DefaultValue', description='The suggested value for the number of EIUs.', example='2'),
    EIURange?: [ long ](name='EIURange', description='The queried range for the number of EIUs.'),
    maxValue?: string(name='MaxValue', description='A reserved parameter.', example='none'),
    minValue?: string(name='MinValue', description='A reserved parameter.', example='none'),
    step?: string(name='Step', description='A reserved parameter.', example='none'),
    storageResourceRange?: [ string ](name='StorageResourceRange', description='A reserved parameter.'),
  }(name='EIUInfo', description='The queried information about the number of EIUs.'),
  requestId?: string(name='RequestId', description='The request ID.', example='D65A809F-34CE-4550-9BC1-0ED21ETG380'),
}

model DescribeEIURangeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeEIURangeResponseBody(name='body'),
}

/**
 * @summary Queries the range for the number of elastic I/O units (EIUs) for an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.
 *
 * @param request DescribeEIURangeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeEIURangeResponse
 */
async function describeEIURangeWithOptions(request: DescribeEIURangeRequest, runtime: Util.RuntimeOptions): DescribeEIURangeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.computeResource)) {
    query['ComputeResource'] = request.computeResource;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.DBClusterVersion)) {
    query['DBClusterVersion'] = request.DBClusterVersion;
  }
  if (!Util.isUnset(request.operation)) {
    query['Operation'] = request.operation;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.productVersion)) {
    query['ProductVersion'] = request.productVersion;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.storageSize)) {
    query['StorageSize'] = request.storageSize;
  }
  if (!Util.isUnset(request.subOperation)) {
    query['SubOperation'] = request.subOperation;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeEIURange',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the range for the number of elastic I/O units (EIUs) for an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.
 *
 * @param request DescribeEIURangeRequest
 * @return DescribeEIURangeResponse
 */
async function describeEIURange(request: DescribeEIURangeRequest): DescribeEIURangeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeEIURangeWithOptions(request, runtime);
}

model DescribeElasticDailyPlanRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the cluster IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a specific region.

This parameter is required.', example='am-bp11q28kvl688****'),
  elasticDailyPlanDay?: string(name='ElasticDailyPlanDay', description='The start date of the current-day scaling plan. Specify the date in the yyyy-MM-dd format.', example='2022-12-02'),
  elasticDailyPlanStatusList?: string(name='ElasticDailyPlanStatusList', description='The execution state of the current-day scaling plan. Separate multiple values with commas (,). Valid values:

*   **1**: The scaling plan is not executed.
*   **2**: The scaling plan is being executed.
*   **3**: The scaling plan is executed.
*   **4**: The scaling plan fails to be executed.', example='3'),
  elasticPlanName?: string(name='ElasticPlanName', description='The name of the scaling plan. Valid values:

*   The name must be 2 to 30 characters in length.
*   The name can contain letters, digits, and underscores (_).', example='realtimeplan'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourcePoolName?: string(name='ResourcePoolName', description='The name of the resource group.

>  You can call the [DescribeDBResourceGroup](https://help.aliyun.com/document_detail/466685.html) operation to query the resource group name.', example='test'),
}

model DescribeElasticDailyPlanResponseBody = {
  elasticDailyPlanList?: [ 
    {
      day?: string(name='Day', description='The start date of the current-day scaling plan. The date is in the yyyy-MM-dd format.', example='2022-12-02'),
      elasticNodeNum?: int32(name='ElasticNodeNum', description='The number of nodes involved in the scaling plan.

*   If ElasticPlanType is set to **worker**, a value of 0 or null is returned.
*   If ElasticPlanType is set to **executorcombineworker** or **executor**, a value greater than 0 is returned.', example='0'),
      elasticPlanType?: string(name='ElasticPlanType', description='The type of the scaling plan. Default value: executorcombineworker. Valid values:

*   **worker**: scales only elastic I/O resources.
*   **executor**: scales only computing resources.
*   **executorcombineworker**: scales both elastic I/O resources and computing resources by proportion.', example='worker'),
      elasticPlanWorkerSpec?: string(name='ElasticPlanWorkerSpec', description='The resource specifications that can be scaled up by the scaling plan. Default value: 8 Core 64 GB. Valid values:

*   8 Core 64 GB
*   16 Core 64 GB
*   32 Core 64 GB
*   64 Core 128 GB
*   12 Core 96 GB
*   24 Core 96 GB
*   52 Core 86 GB', example='16 Core 64 GB'),
      endTs?: string(name='EndTs', description='The actual restoration time. The time is in the yyyy-MM-dd hh:mm:ss format. The time is displayed in UTC.', example='2022-12-02 16:00:00'),
      planEndTs?: string(name='PlanEndTs', description='The scheduled restoration time. The time is in the yyyy-MM-dd hh:mm:ss format. The time is displayed in UTC.', example='2022-12-02 16:00:00'),
      planName?: string(name='PlanName', description='The name of the scaling plan.', example='realtimeplan'),
      planStartTs?: string(name='PlanStartTs', description='The scheduled scale-up time. The time is in the yyyy-MM-dd hh:mm:ss format. The time is displayed in UTC.', example='2022-12-02 15:00:00'),
      resourcePoolName?: string(name='ResourcePoolName', description='The name of the resource group.', example='test'),
      startTs?: string(name='StartTs', description='The actual scale-up time. The time is in the yyyy-MM-dd hh:mm:ss format. The time is displayed in UTC.', example='2022-12-02 16:00:00'),
      status?: int32(name='Status', description='The execution state of the current-day scaling plan. Multiple values are separated by commas (,). Valid values:

*   **1**: The scaling plan is not executed.
*   **2**: The scaling plan is being executed.
*   **3**: The scaling plan is executed.
*   **4**: The scaling plan fails to be executed.', example='3'),
    }
  ](name='ElasticDailyPlanList', description='Details of the current-day scaling plans.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeElasticDailyPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeElasticDailyPlanResponseBody(name='body'),
}

/**
 * @summary 查看日资源弹性
 *
 * @description This operation is available only for AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters in elastic mode for Cluster Edition that have 32 cores or more.
 *
 * @param request DescribeElasticDailyPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeElasticDailyPlanResponse
 */
async function describeElasticDailyPlanWithOptions(request: DescribeElasticDailyPlanRequest, runtime: Util.RuntimeOptions): DescribeElasticDailyPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.elasticDailyPlanDay)) {
    query['ElasticDailyPlanDay'] = request.elasticDailyPlanDay;
  }
  if (!Util.isUnset(request.elasticDailyPlanStatusList)) {
    query['ElasticDailyPlanStatusList'] = request.elasticDailyPlanStatusList;
  }
  if (!Util.isUnset(request.elasticPlanName)) {
    query['ElasticPlanName'] = request.elasticPlanName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourcePoolName)) {
    query['ResourcePoolName'] = request.resourcePoolName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeElasticDailyPlan',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查看日资源弹性
 *
 * @description This operation is available only for AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters in elastic mode for Cluster Edition that have 32 cores or more.
 *
 * @param request DescribeElasticDailyPlanRequest
 * @return DescribeElasticDailyPlanResponse
 */
async function describeElasticDailyPlan(request: DescribeElasticDailyPlanRequest): DescribeElasticDailyPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeElasticDailyPlanWithOptions(request, runtime);
}

model DescribeElasticPlanRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='am-bp278jg9****'),
  elasticPlanEnable?: boolean(name='ElasticPlanEnable', description='Specifies whether the scaling plan takes effect. Valid values:

*   **true** (default)
*   **false**', example='true'),
  elasticPlanName?: string(name='ElasticPlanName', description='The name of the scaling plan.

*   The name must be 2 to 30 characters in length.
*   The name can contain letters, digits, and underscores (_).

> If you do not specify this parameter, the information about all scaling plans for the specified cluster is returned.', example='realtime'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourcePoolName?: string(name='ResourcePoolName', description='The name of the resource group.

> You can call the [DescribeDBResourceGroup](https://help.aliyun.com/document_detail/466685.html) operation to query the resource group name.', example='USER_DEFAULT'),
}

model DescribeElasticPlanResponseBody = {
  elasticPlanList?: [ 
    {
      elasticNodeNum?: int32(name='ElasticNodeNum', description='The number of nodes that are involved in the scaling plan.

*   If ElasticPlanType is set to **worker**, a value of 0 or null is returned.
*   If ElasticPlanType is set to **executorcombineworker** or **executor**, a value greater than 0 is returned.', example='0'),
      elasticPlanType?: string(name='ElasticPlanType', description='The type of the scaling plan. Valid values:

*   **worker**: scales only elastic I/O resources.
*   **executor**: scales only computing resources.
*   **executorcombineworker** (default): scales both elastic I/O resources and computing resources by proportion.', example='worker'),
      elasticPlanWorkerSpec?: string(name='ElasticPlanWorkerSpec', description='The resource specifications that can be scaled up by the scaling plan. Valid values:

*   8 Core 64 GB (default)
*   16 Core 64 GB
*   32 Core 64 GB
*   64 Core 128 GB
*   12 Core 96 GB
*   24 Core 96 GB
*   52 Core 86 GB', example='16 Core 64 GB'),
      enable?: boolean(name='Enable', description='Indicates whether the scaling plan takes effect. Valid values:

*   **true** (default)
*   **false**', example='true'),
      endDay?: string(name='EndDay', description='The end date of the scaling plan. This parameter is returned only if the end date of the scaling plan is set. The date is in the yyyy-MM-dd format.', example='2022-12-09'),
      endTime?: string(name='EndTime', description='The restoration time of the scaling plan. The interval between the scale-up time and the restoration time cannot be more than 24 hours. The time is in the HH:mm:ss format.', example='10:00:00'),
      monthlyRepeat?: string(name='MonthlyRepeat', description='The days of the month when the scaling plan was executed. A value indicates a day of the month. Multiple values are separated by commas (,).', example='1,15,25'),
      planName?: string(name='PlanName', description='The name of the scaling plan.', example='realtime'),
      resourcePoolName?: string(name='ResourcePoolName', description='The name of the resource group.', example='USER_DEFAULT'),
      startDay?: string(name='StartDay', description='The start date of the scaling plan. This parameter is returned only if the start date of the scaling plan is set. The date is in the yyyy-MM-dd format.', example='2022-12-02'),
      startTime?: string(name='StartTime', description='The scale-up time of the scaling plan. The time is in the HH:mm:ss format.', example='08:00:00'),
      weeklyRepeat?: string(name='WeeklyRepeat', description='The days of the week when the scaling plan was executed. Valid values: 0 to 6, which indicate Sunday to Saturday. Multiple values are separated by commas (,).', example='3,4,5,6'),
    }
  ](name='ElasticPlanList', description='The queried scaling plans.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeElasticPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeElasticPlanResponseBody(name='body'),
}

/**
 * @summary Queries scaling plans of an AnalyticDB for MySQL cluster. This operation can be used only for AnalyticDB for MySQL clusters in elastic mode for Cluster Edition.
 *
 * @description ###
 * You can call this operation only for AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters in elastic mode for Cluster Edition that have 32 cores or more.
 *
 * @param request DescribeElasticPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeElasticPlanResponse
 */
async function describeElasticPlanWithOptions(request: DescribeElasticPlanRequest, runtime: Util.RuntimeOptions): DescribeElasticPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.elasticPlanEnable)) {
    query['ElasticPlanEnable'] = request.elasticPlanEnable;
  }
  if (!Util.isUnset(request.elasticPlanName)) {
    query['ElasticPlanName'] = request.elasticPlanName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourcePoolName)) {
    query['ResourcePoolName'] = request.resourcePoolName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeElasticPlan',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries scaling plans of an AnalyticDB for MySQL cluster. This operation can be used only for AnalyticDB for MySQL clusters in elastic mode for Cluster Edition.
 *
 * @description ###
 * You can call this operation only for AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters in elastic mode for Cluster Edition that have 32 cores or more.
 *
 * @param request DescribeElasticPlanRequest
 * @return DescribeElasticPlanResponse
 */
async function describeElasticPlan(request: DescribeElasticPlanRequest): DescribeElasticPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeElasticPlanWithOptions(request, runtime);
}

model DescribeExcessivePrimaryKeysRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='am-bp1u8c0mgfg58****'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time must be in UTC.', example='2023-05-15T07:15Z'),
  lang?: string(name='Lang', description='The display language of the suggestion. Valid values:

*   **zh (default)**: simplified Chinese.
*   **en**: English.
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  order?: string(name='Order', description='The order by which to sort query results. Specify the parameter value in the JSON format. Example: `[{"Field":"TableSchema","Type":"Asc"}]`.

*   `Field` specifies the field by which to sort the query results. Valid values:

    *   `TableSchema`: the name of the database to which the table belongs.
    *   `TableName`: the name of the table.
    *   `AccessCount`: the number of accesses to the table.

*   `Type` specifies the sorting order. Valid values:

    *   `Asc`: ascending order.
    *   `Desc`: descending order.

>  If you do not specify this parameter, query results are sorted in ascending order based on the database and the table.', example='[{"Field":"TableName","Type":"Desc"}]'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='20'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/454314.html) operation to query the most recent region list.

This parameter is required.', example='cn-beijing'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time must be in UTC.', example='2021-09-30T00:10Z'),
}

model DescribeExcessivePrimaryKeysResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The details about the access denial.

>  This parameter is returned only if Resource Access Management (RAM) permission verification failed.', example='{
    "PolicyType": "AccountLevelIdentityBasedPolicy",
    "AuthPrincipalOwnerId": "1906102576997697",
    "EncodedDiagnosticMessage": "AQIBIAAAAOPdwKY2QLOvgMEc7SkkoJfj1kvZwsaRqNYMh10Tv0wTe0fCzaCdrvgazfNb0EnJKETgXyhR+3BIQjx9WAqZryejBsp1Bl4qI5En/D9dEhcXAtKCxCmE2kZCiEzpy8BoEUt+bs0DmlaGWO5xkEpttypLIB4rUhDvZd+zwPg4EXk4KSSWSWsurxtqDkKEMshKlQFBTKvJcNqPqHV6lwR4INiAGjIvK1ngXxN1O+6ORRB6A8YvztEOGywOk81ZmuNk0YrNy+qk7+UVDTHeXKsy8h9e/ePY/LMidj0RCmDpo/YpCumd0UGe0qEPe2U+UJAm/+UHlnEFLVg6BP3yIB5D++MCy7mgWm8Kwyhk62IeYly4hQ+5IpXjkh1GQXuDgLVVPVpxEek9n30vnCUL4KsaMgfa7dgojb+3TM8xGsD2zVK5STJNrsXclscIJEqyNXd7CBYiRJVZi1HPO6drN9WW0chLpCSTgjO8n0bNanZaxXKumW9PSwV58UoSFASeMWfZK3TLngX+oq8nGmnTwcJosVjfF4RGzAnS1IXt0Q9N2WHDnpwyLBU/nOz7Hsy8IZ+h+OVjsBTXSM9688/vOF707a5mNzpETvQeGRcua3A5livcKAM2cML0yeUs/Zyj/+BGqtVa+wektspDHC/CECh6R5lxQjRmUdPawY8VDs2onmdLuEH8DdmYt+Yv/jBFBUMWOyAluzkPYcX5nuQKouCIUJUFTSbsJsuH5CTIh7Ls5rbmkj+T1qTVz8gnDR8LxwaqoMSna+elXgVyOOxXtMkenVntsmoC3p/4G7yTPL1hu8JyWGIIvZHZGGLXGEH7FeSuMV8buKxPGFWG3arG8e9LGvDdz5dgTien4y6G5AQ0o1iQdXDos5VWdH3u7k5PrsvdEOpvMi6uSd8a42na80FsYlgGlwM5upydcWUC5Un2HCkJpT1xgk2L6shdVTrK6bidRrqE784FhW9bBQePzGaxSupPENZya0VUctRt+7uq3QwIn4y5jzjgX0E0jgmqPrgiVDjBesMQZYfGPCGysWYWYzfoh+G6V7N2VVGtNnGUwNWzM0WJBPONAgxPv+AmixFRCQ==",
    "AuthPrincipalType": "SubUser",
    "AuthPrincipalDisplayName": "202515810214480629",
    "NoPermissionType": "ImplicitDeny",
    "AuthAction": "adb:DescribeExcessivePrimaryKeys"
  }'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.', example='am-bp11q28kvl688****'),
  detectionItems?: [ 
    {
      message?: string(name='Message', description='The detection result.', example='OK'),
      name?: string(name='Name', description='The name of the detection item.', example='evm_identity'),
      status?: string(name='Status', description='The severity level of the detection result.', example='NORMAL
WARNING
CRITICAL'),
    }
  ](name='DetectionItems', description='The queried detection items and detection results.'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  tables?: [ 
    {
      columnCount?: int32(name='ColumnCount', description='The total number of columns.', example='26'),
      primaryKeyColumns?: string(name='PrimaryKeyColumns', description='The queried primary key fields.', example='id,date'),
      primaryKeyCount?: int32(name='PrimaryKeyCount', description='The number of primary key fields.', example='1'),
      primaryKeyIndexSize?: long(name='PrimaryKeyIndexSize', description='The data size of primary key indexes. Unit: bytes.', example='2345'),
      schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
      spaceRatio?: double(name='SpaceRatio', description='The percentage of the table size. Unit: %.

>  Formula: Table storage percentage = Total data size of a table/Total data size of the cluster × 100%.', example='20'),
      tableName?: string(name='TableName', description='The name of the table.', example='test'),
      totalSize?: long(name='TotalSize', description='The cold data size. Unit: bytes.

>  Formula: Cold data size = Data size of table records + Data size of regular indexes + Data size of primary key indexes + Size of other data.', example='1073741824'),
    }
  ](name='Tables', description='The queried tables.'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model DescribeExcessivePrimaryKeysResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeExcessivePrimaryKeysResponseBody(name='body'),
}

/**
 * @summary Queries the tables that have excessive primary key fields in an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.
 *
 * @param request DescribeExcessivePrimaryKeysRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeExcessivePrimaryKeysResponse
 */
async function describeExcessivePrimaryKeysWithOptions(request: DescribeExcessivePrimaryKeysRequest, runtime: Util.RuntimeOptions): DescribeExcessivePrimaryKeysResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeExcessivePrimaryKeys',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the tables that have excessive primary key fields in an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.
 *
 * @param request DescribeExcessivePrimaryKeysRequest
 * @return DescribeExcessivePrimaryKeysResponse
 */
async function describeExcessivePrimaryKeys(request: DescribeExcessivePrimaryKeysRequest): DescribeExcessivePrimaryKeysResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeExcessivePrimaryKeysWithOptions(request, runtime);
}

model DescribeExecutorDetectionRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/454250.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-xxxx'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

> 

*   The end time must be later than the start time.

*   The maximum time range that can be specified is 24 hours.', example='2021-05-27T16:00Z'),
  lang?: string(name='Lang', description='The language. Valid values:

*   **zh**: simplified Chinese.
*   **en**: English.', example='zh'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time must be in UTC.', example='2024-10-31T02:06Z'),
}

model DescribeExecutorDetectionResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-xxxx'),
  detectionItems?: [ 
    {
      message?: string(name='Message', description='The information about the detection result.', example='Large amounts of memory resources are used by the Aggregation operator.'),
      name?: string(name='Name', description='The name of the detection item.', example='CPU increase detection'),
      results?: {
        operatorAgg?: [ 
          {
            metricName?: string(name='MetricName', description='The name of the detection metric.', example='PeakMemory'),
            searchResults?: [ 
              {
                avgValue?: double(name='AvgValue', description='The average value of the operator metric.', example='235.5'),
                maxValue?: long(name='MaxValue', description='The maximum value of the operator metric.', example='2335'),
                operatorCount?: long(name='OperatorCount', description='The number of occurrences of the operator.', example='5'),
                operatorName?: string(name='OperatorName', description='The name of the operator.', example='Aggregation'),
                totalValue?: long(name='TotalValue', description='The cumulative value of the operator metric.', example='234'),
              }
            ](name='SearchResults', description='The detection result items of operator metric aggregation.'),
          }
        ](name='OperatorAgg', description='The detection result items of operator metric aggregation.'),
        operatorDetails?: [ 
          {
            metricName?: string(name='MetricName', description='The name of the detection metric.', example='PeakMemory'),
            searchResults?: [ 
              {
                inputRows?: long(name='InputRows', description='The number of rows input by the operator.', example='123'),
                inputSize?: long(name='InputSize', description='The amount of data input by the operator. Unit: bytes.', example='2345'),
                operatorCost?: double(name='OperatorCost', description='The total CPU time consumed by all operators in the stage, which is equivalent to the total CPU time of the stage. You can use this parameter to determine which parts of the stage consume a large amount of computing resources. Unit: milliseconds.', example='2354'),
                operatorInfo?: string(name='OperatorInfo', description='The property information about the operator.', example='GROUP BY field: uid'),
                operatorName?: string(name='OperatorName', description='The name of the operator.', example='TableScan'),
                outputRows?: long(name='OutputRows', description='The number of rows output by the operator.', example='2354'),
                outputSize?: long(name='OutputSize', description='The amount of data output by the operator. Unit: bytes.', example='2345'),
                peakMemory?: long(name='PeakMemory', description='The peak memory of the operator.', example='2334'),
                processId?: string(name='ProcessId', description='The query ID that can be used for diagnostics.', example='202405061006230110150170540315119xxxx'),
                stageId?: string(name='StageId', description='The stage ID.', example='Stage[7]'),
              }
            ](name='SearchResults', description='The detection result items of abnormal operators.'),
          }
        ](name='OperatorDetails', description='The detection result items of abnormal operators.'),
      }(name='Results', description='The detection result items.'),
      status?: string(name='Status', description='The severity level of the detection result. Valid values:

*   NORMAL
*   WARNING
*   CRITICAL', example='WARNING'),
    }
  ](name='DetectionItems', description='The queried detection items and detection results.'),
  requestId?: string(name='RequestId', description='The request ID.', example='B20BA053-27A1-5FDF-B063-6D6146720DF6'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='20'),
}

model DescribeExecutorDetectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeExecutorDetectionResponseBody(name='body'),
}

/**
 * @summary Queries the diagnostic results of the compute layer.
 *
 * @param request DescribeExecutorDetectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeExecutorDetectionResponse
 */
async function describeExecutorDetectionWithOptions(request: DescribeExecutorDetectionRequest, runtime: Util.RuntimeOptions): DescribeExecutorDetectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeExecutorDetection',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the diagnostic results of the compute layer.
 *
 * @param request DescribeExecutorDetectionRequest
 * @return DescribeExecutorDetectionResponse
 */
async function describeExecutorDetection(request: DescribeExecutorDetectionRequest): DescribeExecutorDetectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeExecutorDetectionWithOptions(request, runtime);
}

model DescribeHistoryEventsStatRequest {
  archiveStatus?: string(name='ArchiveStatus', description='The status of the event. Valid values:

*   Archived
*   UnArchived
*   All', example='All'),
  fromStartTime?: string(name='FromStartTime', description='The beginning of the time range to query. Only tasks that have a start time later than or equal to the time specified by this parameter are queried. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. The start time can be up to 30 days earlier than the current time. If you set this parameter to a time more than 30 days earlier than the current time, this time is automatically converted to a time that is exactly 30 days earlier than the current time.', example='2022-01-02T11:31:03Z'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  productId?: string(name='ProductId', description='The product ID.', example='adb'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  toStartTime?: string(name='ToStartTime', description='The end of the time range to query. Only tasks that have a start time earlier than or equal to the time specified by this parameter are queried. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2022-03-02T11:31:03Z'),
}

model DescribeHistoryEventsStatResponseBody = {
  items?: [ 
    {
      eventCategory?: string(name='EventCategory', description='The system event category. Valid values:

*   Exception
*   Optimize
*   Notification
*   Maintenance', example='Exception'),
      totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='2'),
    }
  ](name='Items', description='The queried events.'),
  requestId?: string(name='RequestId', description='The request ID.', example='BA0F6761-7A8C-59F8-9624-FB56788C0EDF'),
}

model DescribeHistoryEventsStatResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHistoryEventsStatResponseBody(name='body'),
}

/**
 * @summary Queries the information about historical events in the event center.
 *
 * @param request DescribeHistoryEventsStatRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHistoryEventsStatResponse
 */
async function describeHistoryEventsStatWithOptions(request: DescribeHistoryEventsStatRequest, runtime: Util.RuntimeOptions): DescribeHistoryEventsStatResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.archiveStatus)) {
    query['ArchiveStatus'] = request.archiveStatus;
  }
  if (!Util.isUnset(request.fromStartTime)) {
    query['FromStartTime'] = request.fromStartTime;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.productId)) {
    query['ProductId'] = request.productId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.toStartTime)) {
    query['ToStartTime'] = request.toStartTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHistoryEventsStat',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about historical events in the event center.
 *
 * @param request DescribeHistoryEventsStatRequest
 * @return DescribeHistoryEventsStatResponse
 */
async function describeHistoryEventsStat(request: DescribeHistoryEventsStatRequest): DescribeHistoryEventsStatResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHistoryEventsStatWithOptions(request, runtime);
}

model DescribeInclinedNodesRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-ufxxxxxxxxxx3q1x1'),
  lang?: string(name='Lang', description='The language of file titles and error messages. Valid values:

*   **zh**: simplified Chinese.
*   **en**: English.
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-beijing'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeInclinedNodesResponseBody = {
  items?: [ 
    {
      diskUsageRatio?: string(name='DiskUsageRatio', description='The disk usage of the storage node. Unit: %.', example='90.5'),
      node?: string(name='Node', description='The number of the storage node.', example='Node1'),
    }
  ](name='Items', description='The queried storage nodes.'),
  requestId?: string(name='RequestId', description='The request ID.', example='8C1A419E-5A79-51A9-B533-FCCB98AD8FD5'),
}

model DescribeInclinedNodesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInclinedNodesResponseBody(name='body'),
}

/**
 * @summary Queries the disk usage of all storage nodes.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeInclinedNodesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInclinedNodesResponse
 */
async function describeInclinedNodesWithOptions(request: DescribeInclinedNodesRequest, runtime: Util.RuntimeOptions): DescribeInclinedNodesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInclinedNodes',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the disk usage of all storage nodes.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request DescribeInclinedNodesRequest
 * @return DescribeInclinedNodesResponse
 */
async function describeInclinedNodes(request: DescribeInclinedNodesRequest): DescribeInclinedNodesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInclinedNodesWithOptions(request, runtime);
}

model DescribeInclinedTablesRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the cluster.

This parameter is required.', example='am-bpxxxxxxxx47'),
  lang?: string(name='Lang'),
  order?: string(name='Order', description='The order in which queries are sorted in the JSON format based on the specified fields. Specify the fields used to sort the queries and the order type.

Example:

```

[

    {

        "Field":"Name",

        "Type":"Asc"

    }

]
```

In the preceding code, Field indicates the field used to sort queries. Set the value of Field to Name.

Type indicates the order type. Valid values of Type: Desc and Asc. A value of Desc indicates a descending order. A value of Asc indicates an ascending order.

Both fields are not case-sensitive.', example='[      {          "Field":"Name",          "Type":"Asc"      }  ]'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values:

*   30
*   50
*   100

Default value: 30.', example='30'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tableType?: string(name='TableType', description='The type of the table. Valid values:

*   FactTable
*   DimensionTable

This parameter is required.', example='FactTable'),
}

model DescribeInclinedTablesResponseBody = {
  detectionItems?: [ 
    {
      message?: string(name='Message'),
      name?: string(name='Name'),
      status?: string(name='Status'),
    }
  ](name='DetectionItems'),
  items?: {
    table?: [ 
      {
        isIncline?: string(name='IsIncline'),
        name?: string(name='Name'),
        rowCount?: long(name='RowCount'),
        schema?: string(name='Schema'),
        size?: string(name='Size'),
        spaceRatio?: double(name='SpaceRatio'),
        totalSize?: long(name='TotalSize'),
        type?: string(name='Type'),
      }
    ](name='Table'),
  }(name='Items', description='The monitoring information about tables.'),
  pageNumber?: string(name='PageNumber', description='The page number.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model DescribeInclinedTablesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeInclinedTablesResponseBody(name='body'),
}

/**
 * @summary Queries the monitoring information about tables.
 *
 * @param request DescribeInclinedTablesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeInclinedTablesResponse
 */
async function describeInclinedTablesWithOptions(request: DescribeInclinedTablesRequest, runtime: Util.RuntimeOptions): DescribeInclinedTablesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tableType)) {
    query['TableType'] = request.tableType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeInclinedTables',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the monitoring information about tables.
 *
 * @param request DescribeInclinedTablesRequest
 * @return DescribeInclinedTablesResponse
 */
async function describeInclinedTables(request: DescribeInclinedTablesRequest): DescribeInclinedTablesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeInclinedTablesWithOptions(request, runtime);
}

model DescribeKernelVersionRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.
> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/98094.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-bp1ub9grke1****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.
> You can call the DescribeRegions operation to query the most recent region list.', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeKernelVersionResponseBody = {
  availableKernelVersions?: [ 
    {
      expireDate?: string(name='ExpireDate', description='The maintenance expiration time of the version. The time follows the ISO 8601 standard in the yyyy-MM-DD HH:mm:ss format. The time is displayed in UTC. After the time arrives, the system no longer maintains the version. If any issues occur, update the minor version of the cluster to a later version.', example='2024-06-01T10:36:30Z'),
      kernelVersion?: string(name='KernelVersion', description='The minor version. Example: **3.1.9**.', example='3.1.9'),
      releaseDate?: string(name='ReleaseDate', description='The time when the minor version was released. The time follows the ISO 8601 standard in the yyyy-MM-DD HH:mm:ss format. The time is displayed in UTC.', example='2023-06-01T10:36:30Z'),
    }
  ](name='AvailableKernelVersions', description='The minor versions to which you can update the current minor version of the cluster.'),
  expireDate?: string(name='ExpireDate', description='The maintenance expiration time of the version. The time follows the ISO 8601 standard in the yyyy-MM-DD HH:mm:ss format. The time is displayed in UTC. After the time arrives, the system no longer maintains the version. If any issues occur, update the minor version of the cluster to a later version.', example='2023-06-01T10:36:30Z'),
  kernelVersion?: string(name='KernelVersion', description='The minor version of the cluster. Example: **3.1.8**.', example='3.1.8'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeKernelVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeKernelVersionResponseBody(name='body'),
}

/**
 * @summary Queries the information about the minor version of an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeKernelVersionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeKernelVersionResponse
 */
async function describeKernelVersionWithOptions(request: DescribeKernelVersionRequest, runtime: Util.RuntimeOptions): DescribeKernelVersionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeKernelVersion',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about the minor version of an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeKernelVersionRequest
 * @return DescribeKernelVersionResponse
 */
async function describeKernelVersion(request: DescribeKernelVersionRequest): DescribeKernelVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeKernelVersionWithOptions(request, runtime);
}

model DescribeKmsKeysRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/612393.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  zoneId?: string(name='ZoneId', description='The zone ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/129857.html) operation to query the most recent zone list.', example='cn-hangzhou-k'),
}

model DescribeKmsKeysResponseBody = {
  kmsKeys?: {
    kmsKey?: [ 
    {
      keyAlias?: string(name='KeyAlias', description='The alias of the key.', example='mykey'),
      keyId?: string(name='KeyId', description='The ID of the key.', example='2e81355b-f8e7-4090-8082-a8f8124a621c'),
    }
  ](name='KmsKey')
  }(name='KmsKeys', description='The queried KMS keys.'),
  requestId?: string(name='RequestId', description='The request ID.', example='8F91F25F-8BCF-59E3-AF67-3806DB41FD09'),
}

model DescribeKmsKeysResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeKmsKeysResponseBody(name='body'),
}

/**
 * @summary Queries a list of Key Management Service (KMS) keys.
 *
 * @param request DescribeKmsKeysRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeKmsKeysResponse
 */
async function describeKmsKeysWithOptions(request: DescribeKmsKeysRequest, runtime: Util.RuntimeOptions): DescribeKmsKeysResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeKmsKeys',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of Key Management Service (KMS) keys.
 *
 * @param request DescribeKmsKeysRequest
 * @return DescribeKmsKeysResponse
 */
async function describeKmsKeys(request: DescribeKmsKeysRequest): DescribeKmsKeysResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeKmsKeysWithOptions(request, runtime);
}

model DescribeLoadTasksRecordsRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters in a region, including cluster IDs.

This parameter is required.', example='am-bp2590j****'),
  DBName?: string(name='DBName', description='The name of the database that is involved in the import or export task.', example='adb_demo'),
  endTime?: string(name='EndTime', description='The end of the time range to query. The end time must be later than the start time. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time must be in UTC.

This parameter is required.', example='2021-05-18T06:30:00Z'),
  order?: string(name='Order', description='The order in which to sort the tasks by field. Specify the field and the sort order in the JSON format. Example: `[{"Field":"CreateTime", "Type":"desc"}]`.

> 

*   `Field` specifies the field that is used to sort the tasks. Valid values of Field: `State`, `CreateTime`, `DBName`, `ProcessID`, `UpdateTime`, `JobName`, and `ProcessRows`.

*   `Type` specifies the sort order. Valid values of Type: `Desc` and `Asc`. The values are case-insensitive.', example='[{"Field":"CreateTime", "Type":"desc"}]'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time must be in UTC.

> We recommend that you set the query start time to any point in time within 30 days.

This parameter is required.', example='2021-05-18T06:00:00Z'),
  state?: string(name='State', description='The state of the asynchronous import or export task to be queried. Valid values:

*   **INIT**: The task is being initialized.
*   **RUNNING**: The task is running.
*   **FINISH**: The task is successful.
*   **FAILED**: The task fails.', example='FINISH'),
}

model DescribeLoadTasksRecordsResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-bp2590j****'),
  loadTasksRecords?: [ 
    {
      createTime?: string(name='CreateTime', description='The start time of the task. The time is accurate to milliseconds. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ss.SSSZ* format. The time is displayed in UTC.', example='2021-05-18 18:47:27.0'),
      DBName?: string(name='DBName', description='The name of the database that is involved in the import or export task.', example='adb_demo'),
      jobName?: string(name='JobName', description='The task ID.', example='2021051818472717201616624903453******'),
      processID?: string(name='ProcessID', description='The process ID.', example='2021051818472717201616624903453******'),
      processRows?: long(name='ProcessRows', description='The number of rows that are processed in the asynchronous import or export task.', example='6'),
      sql?: string(name='Sql', description='The SQL statement that is used in the asynchronous import or export task.', example='insert overwrite into courses_external_table\\\\nselect * from courses'),
      state?: string(name='State', description='The state of the task.', example='FINISH'),
      updateTime?: string(name='UpdateTime', description='The time when the task state was updated. The time is accurate to milliseconds. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ss.SSSZ* format. The time is displayed in UTC.', example='2021-05-18 18:47:31.0'),
    }
  ](name='LoadTasksRecords', description='The queried asynchronous import and export tasks.'),
  pageNumber?: string(name='PageNumber', description='The page number.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='C60B05DB-2B77-421A-98E9-92C20E******'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model DescribeLoadTasksRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeLoadTasksRecordsResponseBody(name='body'),
}

/**
 * @summary Queries the information about asynchronous import and export tasks of an AnalyticDB for MySQL cluster.
 *
 * @description For information about how to asynchronously submit import and export tasks, see [Asynchronously submit an import or export task](https://help.aliyun.com/document_detail/160291.html).
 *
 * @param request DescribeLoadTasksRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeLoadTasksRecordsResponse
 */
async function describeLoadTasksRecordsWithOptions(request: DescribeLoadTasksRecordsRequest, runtime: Util.RuntimeOptions): DescribeLoadTasksRecordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.DBName)) {
    query['DBName'] = request.DBName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.state)) {
    query['State'] = request.state;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeLoadTasksRecords',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about asynchronous import and export tasks of an AnalyticDB for MySQL cluster.
 *
 * @description For information about how to asynchronously submit import and export tasks, see [Asynchronously submit an import or export task](https://help.aliyun.com/document_detail/160291.html).
 *
 * @param request DescribeLoadTasksRecordsRequest
 * @return DescribeLoadTasksRecordsResponse
 */
async function describeLoadTasksRecords(request: DescribeLoadTasksRecordsRequest): DescribeLoadTasksRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeLoadTasksRecordsWithOptions(request, runtime);
}

model DescribeLogHubAttributeRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.

This parameter is required.', example='am-bp1nz6smy07szs58p'),
  deliverName?: string(name='DeliverName', description='The name of the log shipping job.

This parameter is required.', example='sz_sls2adb_kxdpz_af_data'),
  logStoreName?: string(name='LogStoreName', description='The name of the Logstore.

This parameter is required.', example='game2-sms-log'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  projectName?: string(name='ProjectName', description='The name of the Simple Log Service project.

This parameter is required.', example='dcsz-af-data'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeLogHubAttributeResponseBody = {
  loghubInfo?: {
    DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-8vbs48m7553du1gz2'),
    DBType?: string(name='DBType', description='The database type.', example='rds'),
    delay?: long(name='Delay', description='The synchronization latency, which is the latency between the latest update time of the synchronization job and the current system time. Unit: seconds.', example='361'),
    deliverName?: string(name='DeliverName', description='The name of the log shipping job.', example='loghub-web-login-new'),
    deliverTime?: string(name='DeliverTime', description='The log shipping time.', example='2024-12-06\\\\"T\\\\"10:15\\\\"Z\\\\"'),
    description?: string(name='Description', description='The description.', example='description'),
    filterDirtyData?: boolean(name='FilterDirtyData', description='Indicates whether dirty data is filtered.', example='true'),
    logHubStores?: {
      logHubStore?: [ 
      {
        fieldKey?: string(name='FieldKey', description='The value of the log keyword.', example='255311'),
        logKey?: string(name='LogKey', description='The log keyword.', example='taskid'),
      }
    ](name='LogHubStore')
    }(name='LogHubStores', description='The names of the Logstores.'),
    logStoreName?: string(name='LogStoreName', description='The name of the Logstore.', example='device_login'),
    message?: string(name='Message', description='The returned message.', example='SUCCESS'),
    projectName?: string(name='ProjectName', description='The name of the Simple Log Service project.', example='test-adb'),
    regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
    schemaName?: string(name='SchemaName', description='The name of the database.', example='cbd_bi'),
    syncStatus?: string(name='SyncStatus', description='The synchronization status.', example='processing'),
    tableName?: string(name='TableName', description='The name of the table.', example='test2'),
    userName?: string(name='UserName', description='The name of the database account.', example='aaa'),
    zoneId?: string(name='ZoneId', description='The zone ID.', example='cn-hangzhou-k'),
  }(name='LoghubInfo', description='The log collection information.'),
  requestId?: string(name='RequestId', description='The request ID.', example='8A564B7F-8C00-43C0-8EC5-919FBB70573'),
}

model DescribeLogHubAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeLogHubAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the information about a log shipping job.
 *
 * @param request DescribeLogHubAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeLogHubAttributeResponse
 */
async function describeLogHubAttributeWithOptions(request: DescribeLogHubAttributeRequest, runtime: Util.RuntimeOptions): DescribeLogHubAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.deliverName)) {
    query['DeliverName'] = request.deliverName;
  }
  if (!Util.isUnset(request.logStoreName)) {
    query['LogStoreName'] = request.logStoreName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.projectName)) {
    query['ProjectName'] = request.projectName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeLogHubAttribute',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a log shipping job.
 *
 * @param request DescribeLogHubAttributeRequest
 * @return DescribeLogHubAttributeResponse
 */
async function describeLogHubAttribute(request: DescribeLogHubAttributeRequest): DescribeLogHubAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeLogHubAttributeWithOptions(request, runtime);
}

model DescribeLogStoreKeysRequest {
  logStoreName?: string(name='LogStoreName', description='The name of the Logstore.

This parameter is required.', example='test-hcl2'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  projectName?: string(name='ProjectName', description='The name of the Simple Log Service project.

This parameter is required.', example='nbgame-point'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeLogStoreKeysResponseBody = {
  logStoreKeys?: {
    logStoreKey?: [ string ](name='LogStoreKey')
  }(name='LogStoreKeys', description='The queried log keywords.'),
  requestId?: string(name='RequestId', description='The request ID.', example='3BB185E9-BB54-1727-B876-13243E4C0EB5'),
}

model DescribeLogStoreKeysResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeLogStoreKeysResponseBody(name='body'),
}

/**
 * @summary Queries a list of log keywords in a Logstore.
 *
 * @param request DescribeLogStoreKeysRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeLogStoreKeysResponse
 */
async function describeLogStoreKeysWithOptions(request: DescribeLogStoreKeysRequest, runtime: Util.RuntimeOptions): DescribeLogStoreKeysResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.logStoreName)) {
    query['LogStoreName'] = request.logStoreName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.projectName)) {
    query['ProjectName'] = request.projectName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeLogStoreKeys',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of log keywords in a Logstore.
 *
 * @param request DescribeLogStoreKeysRequest
 * @return DescribeLogStoreKeysResponse
 */
async function describeLogStoreKeys(request: DescribeLogStoreKeysRequest): DescribeLogStoreKeysResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeLogStoreKeysWithOptions(request, runtime);
}

model DescribeLoghubDetailRequest {
  exportName?: string(name='ExportName', description='The name of the log shipping job.

This parameter is required.', example='wap_log_full_to_adb'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  projectName?: string(name='ProjectName', description='The name of the Simple Log Service project.

This parameter is required.', example='sls-hz-php-ad'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-4690g37929****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeLoghubDetailResponseBody = {
  loghubInfo?: {
    DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-8vbs48m7553du1gz2'),
    DBType?: string(name='DBType', description='The database type.', example='rds'),
    deliverName?: string(name='DeliverName', description='The name of the log shipping job.', example='hub-pay-callback-ykt'),
    deliverTime?: string(name='DeliverTime', description='The log shipping time.', example='2024-12-06\\\\"T\\\\"10:15\\\\"Z\\\\"'),
    description?: string(name='Description', description='The description.', example='aaa'),
    domainUrl?: string(name='DomainUrl', description='The endpoint.', example='am-bp1p38m2c26s7hpk690650.ads.aliyuncs.com'),
    filterDirtyData?: boolean(name='FilterDirtyData', description='Indicates whether dirty data is filtered.', example='true'),
    logHubStores?: {
      logHubStore?: [ 
      {
        fieldKey?: string(name='FieldKey', description='The value of the log keyword.', example='channel_id'),
        logKey?: string(name='LogKey', description='The log keyword.', example='put_request'),
      }
    ](name='LogHubStore')
    }(name='LogHubStores', description='The log keywords.'),
    logStoreName?: string(name='LogStoreName', description='The name of the Logstore.', example='device_login'),
    projectName?: string(name='ProjectName', description='The name of the Simple Log Service project.', example='test-adb'),
    regionId?: string(name='RegionId', description='The region ID.', example='cn-shenzhen'),
    schemaName?: string(name='SchemaName', description='The name of the database.', example='cbd_bi'),
    tableName?: string(name='TableName', description='The name of the table.', example='test2'),
    userName?: string(name='UserName', description='The name of the database account.', example='test'),
    zoneId?: string(name='ZoneId', description='The zone ID.', example='cn-hangzhou-k'),
  }(name='LoghubInfo', description='The queried log collection information.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeLoghubDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeLoghubDetailResponseBody(name='body'),
}

/**
 * @summary Queries the log collection information.
 *
 * @param request DescribeLoghubDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeLoghubDetailResponse
 */
async function describeLoghubDetailWithOptions(request: DescribeLoghubDetailRequest, runtime: Util.RuntimeOptions): DescribeLoghubDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.exportName)) {
    query['ExportName'] = request.exportName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.projectName)) {
    query['ProjectName'] = request.projectName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeLoghubDetail',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the log collection information.
 *
 * @param request DescribeLoghubDetailRequest
 * @return DescribeLoghubDetailResponse
 */
async function describeLoghubDetail(request: DescribeLoghubDetailRequest): DescribeLoghubDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeLoghubDetailWithOptions(request, runtime);
}

model DescribeMaintenanceActionRequest {
  isHistory?: int32(name='IsHistory', description='Specifies whether to return the information about pending or historical O\\\\&M events. Valid values:

*   **0**: returns the information about pending O\\\\&M event.
*   **1**: returns the information about historical O\\\\&M event.

If you do not specify this parameter, the information about pending O\\\\&M event are returned.', example='1'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values: **30**, **50**, and **100**. Default value: 30.', example='30'),
  region?: string(name='Region', description='The region ID. Valid values:

*   The ID of the region where the O\\\\&M event occurs. Example: `cn-hangzhou`. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.
*   You can also set Region to `all` to query the O\\\\&M events in all regions. If you set `Region` to `all`, you must set `TaskType` to `all`.

This parameter is required.', example='cn-hangzhou'),
  regionId?: string(name='RegionId', description='The ID of the region where the O\\\\&M event occurs.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskType?: string(name='TaskType', description='The type of the O\\\\&M event. Valid values:

*   **rds_apsaradb_upgrade**: database software upgrades.
*   **all**: all the O\\\\&M events in all regions within the current account. If you set `Region` to `all`, you must set `TaskType` to `all`.

This parameter is required.', example='rds_apsaradb_upgrade'),
}

model DescribeMaintenanceActionResponseBody = {
  items?: [ 
    {
      createdTime?: string(name='CreatedTime', description='The time when the O\\\\&M event was created. The time follows the ISO 8601 standard in the `yyyy-MM-ddTHH:mm:ssZ` format. The time is displayed in UTC.', example='2021-06-30T02:44:27Z'),
      DBClusterId?: string(name='DBClusterId', description='The ID of the cluster that is involved in the O\\\\&M event.', example='am-****************'),
      DBType?: string(name='DBType', description='The database engine.', example='analyticdb'),
      DBVersion?: string(name='DBVersion', description='The version of the database engine.', example='3.0'),
      deadline?: string(name='Deadline', description='The deadline before which the event can be executed. The time follows the ISO 8601 standard in the `yyyy-MM-ddTHH:mm:ssZ` format. The time is displayed in UTC.', example='2021-07-04T15:59:59Z'),
      id?: int32(name='Id', description='The ID of the O\\\\&M event.', example='11111'),
      modifiedTime?: string(name='ModifiedTime', description='The point in time at which the switchover time of the O\\\\&M event was modified. The time follows the ISO 8601 standard in the `yyyy-MM-ddTHH:mm:ssZ` format. The time is displayed in UTC.', example='2021-07-03T06:33:00Z'),
      prepareInterval?: string(name='PrepareInterval', description='The preparation time that is required before the pending O\\\\&M event can be switched. The time is in the `HH:mm:ss` format.', example='02:00:00'),
      region?: string(name='Region', description='The ID of the region where the O\\\\&M event occurs.', example='cn-hangzhou'),
      resultInfo?: string(name='ResultInfo', description='The execution result of the O\\\\&M event.

> This parameter is returned only when the value of `Status` is **FAILED** or **CANCEL**.', example='autoCancel'),
      startTime?: string(name='StartTime', description='The time when the task was executed in the backend. The time follows the ISO 8601 standard in the `yyyy-MM-ddTHH:mm:ssZ` format. The time is displayed in UTC.', example='2021-07-03T04:00:00Z'),
      status?: string(name='Status', description='The state of the event.

*   If you set `IsHistory` to **0**, the state of the pending O\\\\&M event is returned. Valid values:

    *   **WAITING_MODIFY**: The start time of the O\\\\&M event is waiting to be set.
    *   **WAITING**: The O\\\\&M event is waiting to be processed.
    *   **PROCESSING**: The O\\\\&M event is being processed. The switchover time of an event in this state cannot be changed.

*   If you set `IsHistory` to **1**, the state of the historical O\\\\&M event is returned. Valid values:

    *   **SUCCESS**: The event ended and the execution succeeded.
    *   **FAILED**: The event ended but the execution failed.
    *   **CANCEL**: The event was canceled.', example='SUCCESS'),
      switchTime?: string(name='SwitchTime', description='The time when the pending O\\\\&M event is switched. The time follows the ISO 8601 standard in the `yyyy-MM-ddTHH:mm:ssZ` format. The time is displayed in UTC.', example='2021-07-03T06:00:00Z'),
      taskType?: string(name='TaskType', description='The type of the O\\\\&M event.', example='rds_apsaradb_upgrade'),
    }
  ](name='Items', description='The queried O\\\\&M events.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='E774C8A9-8819-4A09-9E91-07C078******'),
  totalRecordCount?: int32(name='TotalRecordCount', description='The total number of entries returned.', example='2'),
}

model DescribeMaintenanceActionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMaintenanceActionResponseBody(name='body'),
}

/**
 * @summary Queries the information about O&M events.
 *
 * @param request DescribeMaintenanceActionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMaintenanceActionResponse
 */
async function describeMaintenanceActionWithOptions(request: DescribeMaintenanceActionRequest, runtime: Util.RuntimeOptions): DescribeMaintenanceActionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.isHistory)) {
    query['IsHistory'] = request.isHistory;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMaintenanceAction',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about O&M events.
 *
 * @param request DescribeMaintenanceActionRequest
 * @return DescribeMaintenanceActionResponse
 */
async function describeMaintenanceAction(request: DescribeMaintenanceActionRequest): DescribeMaintenanceActionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMaintenanceActionWithOptions(request, runtime);
}

model DescribeOperatorPermissionRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='rm-uf6wjk5xxxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeOperatorPermissionResponseBody = {
  createdTime?: string(name='CreatedTime', description='The time when the permissions take effect.', example='2019-05-20T05:41:19Z'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='rm-uf6wjk5xxxxxxxxxx'),
  expiredTime?: string(name='ExpiredTime', description='The time when the permissions expire.', example='2019-05-20T07:41:19Z'),
  privileges?: string(name='Privileges', description='The types of the permissions. Valid values: Control and Data.', example='Control,Data'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeOperatorPermissionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeOperatorPermissionResponseBody(name='body'),
}

/**
 * @summary Queries the details of the permissions granted to the service account of an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeOperatorPermissionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeOperatorPermissionResponse
 */
async function describeOperatorPermissionWithOptions(request: DescribeOperatorPermissionRequest, runtime: Util.RuntimeOptions): DescribeOperatorPermissionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeOperatorPermission',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of the permissions granted to the service account of an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeOperatorPermissionRequest
 * @return DescribeOperatorPermissionResponse
 */
async function describeOperatorPermission(request: DescribeOperatorPermissionRequest): DescribeOperatorPermissionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeOperatorPermissionWithOptions(request, runtime);
}

model DescribeOversizeNonPartitionTableInfosRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-8vb46cpn2aaxxxxxx'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time must be in UTC.', example='2021-05-03T15:01:00Z'),
  lang?: string(name='Lang', description='The language of file titles and error messages. Valid values:

*   **zh**: simplified Chinese.
*   **en**: English.
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  order?: string(name='Order', description='The order by which to sort query results. Specify the parameter value in the JSON format. Example: `[{"Field":"SchemaName","Type":"Desc"}]`.

*   `Field` specifies the field by which to sort the query results. Valid values:

    *   `SchemaName`: the name of the database to which the table belongs.
    *   `TableName`: the name of the table.
    *   `IndexSize`: the data size of regular indexes.
    *   `PrimaryKeySize`: the data size of the primary key index.
    *   `DataSize`: the data size of table records.
    *   `LocalDataSize`: the size of hot data.
    *   `RemoteDataSize`: the size of cold data.
    *   `SpaceRatio`: the storage percentage of the table.

*   `Type` specifies the sorting order. Valid values:

    *   `Asc`: ascending order.
    *   `Desc`: descending order.

>  If you do not specify this parameter, the query results are sorted by the total data size of each table in descending order.', example='[{\\\\"Field\\\\":\\\\"SchemaName\\\\",\\\\"Type\\\\":\\\\"Asc\\\\"}]'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='30'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.', example='2022-09-06T03:06:00Z'),
}

model DescribeOversizeNonPartitionTableInfosResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-8vb46cpn2aaxxxxxx'),
  detectionItems?: [ 
    {
      message?: string(name='Message', description='The information about the detection result.', example='Multiple oversized non-partitioned tables are detected.'),
      name?: string(name='Name', description='The name of the detection item.', example='Oversized non-partitioned tables'),
      status?: string(name='Status', description='The severity level of the detection result. Valid values:

*   NORMAL
*   WARNING
*   CRITICAL', example='WARNING'),
    }
  ](name='DetectionItems', description='The queried detection items and detection results.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='100'),
  requestId?: string(name='RequestId', description='The request ID.', example='F67B5AC5-6CDE-5187-9E25-B1EEE9AC4D91'),
  tables?: [ 
    {
      dataSize?: long(name='DataSize', description='The data size of table records. Unit: bytes.

>  The data size of table records does not include the data size of regular and primary key indexes.', example='21474836480'),
      indexSize?: long(name='IndexSize', description='The data size of regular indexes. Unit: bytes.', example='1073741824'),
      localDataSize?: long(name='LocalDataSize', description='The size of hot data. Unit: bytes.', example='24696061952'),
      primaryKeySize?: long(name='PrimaryKeySize', description='The data size of the primary key index. Unit: bytes.', example='2147483648'),
      remoteDataSize?: long(name='RemoteDataSize', description='The size of cold data. Unit: bytes.', example='0'),
      rowCount?: long(name='RowCount', description='The number of rows in the table.', example='3294'),
      schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
      spaceRatio?: double(name='SpaceRatio', description='The storage percentage of the table. Unit: %.

>  Formula: Table storage percentage = Total data size of a table/Total data size of the cluster × 100%.', example='23'),
      tableName?: string(name='TableName', description='The name of the table.', example='test'),
    }
  ](name='Tables', description='The queried oversized non-partitioned tables.'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='21'),
}

model DescribeOversizeNonPartitionTableInfosResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeOversizeNonPartitionTableInfosResponseBody(name='body'),
}

/**
 * @summary Queries the information about oversized non-partitioned tables in an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeOversizeNonPartitionTableInfosRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeOversizeNonPartitionTableInfosResponse
 */
async function describeOversizeNonPartitionTableInfosWithOptions(request: DescribeOversizeNonPartitionTableInfosRequest, runtime: Util.RuntimeOptions): DescribeOversizeNonPartitionTableInfosResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeOversizeNonPartitionTableInfos',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about oversized non-partitioned tables in an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeOversizeNonPartitionTableInfosRequest
 * @return DescribeOversizeNonPartitionTableInfosResponse
 */
async function describeOversizeNonPartitionTableInfos(request: DescribeOversizeNonPartitionTableInfosRequest): DescribeOversizeNonPartitionTableInfosResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeOversizeNonPartitionTableInfosWithOptions(request, runtime);
}

model DescribePatternPerformanceRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-****************'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time must be in UTC.

> The end time must be later than the start time.

This parameter is required.', example='2021-11-18T18:05:00Z'),
  patternId?: string(name='PatternId', description='The SQL pattern ID.

> You can call the [DescribeSQLPatterns](https://help.aliyun.com/document_detail/321868.html) operation to query the information about all SQL patterns in an AnalyticDB for MySQL cluster within a period of time, including SQL pattern IDs.

This parameter is required.', example='3847585356974******'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time must be in UTC.

> 

*   Only data within the last 14 days can be queried. For example, if the current date is November 22 (UTC+8), you can query data on a day as early as November 9 by setting StartTime to 2021-11-08T16:00:00Z. If you set StartTime to a value earlier than 2021-11-08T16:00:00Z, the Performances parameter is empty.

*   The maximum time range that can be specified is 24 hours.

This parameter is required.', example='2021-11-18T00:00:00Z'),
}

model DescribePatternPerformanceResponseBody = {
  accessIp?: string(name='AccessIp', description='The IP address of the SQL client that submits the SQL pattern.', example='172.16.14.*'),
  endTime?: string(name='EndTime', description='The end time of the query. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time is displayed in UTC.', example='2021-11-18T18:05Z'),
  failedCount?: long(name='FailedCount', description='The number of failed SQL patterns within the time range.', example='0'),
  performances?: [ 
    {
      key?: string(name='Key', description='The performance metric that was queried. Valid values:

*   **AnalyticDB_PatternQueryCount**: the total number of queries executed in association with the SQL pattern.
*   **AnalyticDB_PatternQueryTime**: the total amount of time consumed by the queries executed in association with the SQL pattern.
*   **AnalyticDB_PatternExecutionTime**: the total execution duration of the queries executed in association with the SQL pattern.
*   **AnalyticDB_PatternPeakMemory**: the peak memory usage of the queries executed in association with the SQL pattern.
*   **AnalyticDB_PatternScanSize**: the amount of data scanned in the queries executed in association with the SQL pattern.', example='AnalyticDB_PatternQueryCount'),
      series?: [ 
        {
          name?: string(name='Name', description='The name of the performance metric value. Valid values:

*   When the `Key` parameter is set to `AnalyticDB_PatternQueryCount`, `pattern_query_count` is returned, which indicates the number of executions of the SQL statements in association with the SQL pattern.

*   When the `Key` parameter is set to `AnalyticDB_PatternQueryTime`, the following values are returned:

    *   `average_query_time`, which indicates the average total amount of time consumed by the SQL statements in association with the SQL pattern.
    *   `max_query_time`, which indicates the maximum total amount of time consumed by the SQL statements in association with the SQL pattern.

*   When the `Key` parameter is set to `AnalyticDB_PatternExecutionTime`, the following values are returned:

    *   `average_execution_time`, which indicates the average execution duration of the SQL statements in association with the SQL pattern.
    *   `max_execution_time`, which indicates the maximum execution duration of the SQL statements in association with the SQL pattern.

*   When the `Key` parameter is set to `AnalyticDB_PatternPeakMemory`, the following values are returned:

    *   `average_peak_memory`, which indicates the average peak memory usage of the SQL statements in association with the SQL pattern.
    *   `max_peak_memory`, which indicates the maximum peak memory usage of the SQL statements in association with the SQL pattern.

*   When the `Key` parameter is set `AnalyticDB_PatternScanSize`, the following values are returned:

    *   `average_scan_size`, which indicates the average amount of data scanned by the SQL statements in association with the SQL pattern.
    *   `max_scan_size`, which indicates the maximum amount of data scanned by the SQL statements in association with the SQL pattern.', example='max_query_time'),
          values?: [ string ](name='Values', description='The queried performance metrics.'),
        }
      ](name='Series', description='The queried performance metrics.'),
      unit?: string(name='Unit', description='The unit of the performance metric. Valid values:

*   When the performance metric is related to the query duration (the `Key` value is `AnalyticDB_PatternQueryTime` or `AnalyticDB_PatternExecutionTime`), **ms** is returned.
*   When the performance metric is related to the memory usage (the `Key` value is `AnalyticDB_PatternPeakMemory`), **MB** is returned.
*   When the performance metric is related to the amount of data scanned (the `Key` value is `AnalyticDB_PatternScanSize`), **MB** is returned.
*   When the performance metric is related to the number of queries (the `Key` value is `AnalyticDB_PatternQueryCount`), this parameter is empty.', example='ms'),
    }
  ](name='Performances', description='The queried performance metrics.'),
  queryCount?: long(name='QueryCount', description='The number of queries executed in association with the SQL pattern within the time range.', example='35018'),
  requestId?: string(name='RequestId', description='The request ID.', example='210f47011634026610213529******'),
  SQLPattern?: string(name='SQLPattern', description='The SQL statement that represents the SQL pattern.', example='SELECT *nFROM HIVE.`ADB_EXTERNAL_TPCH_10GB`.`External_customer`nLIMIT ?'),
  startTime?: string(name='StartTime', description='The start time of the query. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time is displayed in UTC.', example='2021-11-18T00:00Z'),
  tables?: string(name='Tables', description='The tables that are in association with the SQL pattern.', example='tpch_1g.part;tpch_1g.supplier;tpch_1g.lineitem;tpch_1g.partsupp;tpch_1g.orders;tpch_1g.nation'),
  user?: string(name='User', description='The database account that is used to execute the SQL statement.', example='test'),
}

model DescribePatternPerformanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePatternPerformanceResponseBody(name='body'),
}

/**
 * @summary Queries the metrics of an SQL pattern such as the query duration and average memory usage within a period of time.
 *
 * @param request DescribePatternPerformanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePatternPerformanceResponse
 */
async function describePatternPerformanceWithOptions(request: DescribePatternPerformanceRequest, runtime: Util.RuntimeOptions): DescribePatternPerformanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.patternId)) {
    query['PatternId'] = request.patternId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePatternPerformance',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the metrics of an SQL pattern such as the query duration and average memory usage within a period of time.
 *
 * @param request DescribePatternPerformanceRequest
 * @return DescribePatternPerformanceResponse
 */
async function describePatternPerformance(request: DescribePatternPerformanceRequest): DescribePatternPerformanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePatternPerformanceWithOptions(request, runtime);
}

model DescribeProcessListRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the cluster.

This parameter is required.', example='am-bp11q28kvl688****'),
  keyword?: string(name='Keyword', description='The keyword in an SQL statement, which is used to filter queries. Set the value to **SELECT**.', example='SELECT'),
  order?: string(name='Order', description='The order in which queries are sorted based on the specified fields. Specify this parameter as an ordered JSON array in the `[{"Field":"Time","Type":"Desc" },{ "Field":"User", "Type":"Asc" }]` format.

*   **Field** specifies the field used to sort queries. Valid values: Time, User, Host, and DB.
*   **Type** specifies the sorting sequence. Valid values: **Desc** and **Asc**.', example='[ { "Field":"Time","Type":"Desc" },  { "Field":"User", "Type":"Asc" }]'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. The value must be an integer that is greater than 0. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  runningTime?: int32(name='RunningTime', description='The execution duration used to filter queries. Queries that take a longer time than the specified execution duration are displayed. Unit: seconds.', example='5'),
  showFull?: boolean(name='ShowFull', description='Specifies whether to show a complete SQL statement. Valid values:

*   **True**: shows a complete SQL statement.
*   **False**: shows only the first 100 characters of an SQL statement.

>  The default value is False.', example='True'),
  user?: string(name='User', description='The name of the user used to filter queries.', example='test'),
}

model DescribeProcessListResponseBody = {
  items?: {
    process?: [ 
    {
      command?: string(name='Command', description='The type of the statement. Only SELECT can be returned.', example='SELECT'),
      DB?: string(name='DB', description='The name of the database.', example='adb_demo'),
      host?: string(name='Host', description='The IP address from which the query was initiated.', example='192.168.XX.XX:12308'),
      id?: int32(name='Id', description='The ID of the worker thread.', example='49104'),
      info?: string(name='Info', description='The SQL statement that is being executed. By default, the first 100 characters of the SQL statement are returned. If the ShowFull parameter is set to True, the complete SQL statement is returned.', example='select * from sbtest1,sbtest2,sbtest3,sbtest4'),
      processId?: string(name='ProcessId', description='The unique ID of the query. You must specify this parameter when you use the KILL PROCESS statement.', example='202011191048151921681492420315100****'),
      startTime?: string(name='StartTime', description='The start time of the query. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2020-11-19T02:48:15Z'),
      time?: int32(name='Time', description='The amount of time that has elapsed from the start time of the query. Unit: seconds.', example='11'),
      user?: string(name='User', description='The username.', example='test'),
    }
  ](name='Process')
  }(name='Items', description='Details of the queries.'),
  pageNumber?: string(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: string(name='PageSize', description='The total number of pages returned.', example='30'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model DescribeProcessListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeProcessListResponseBody(name='body'),
}

/**
 * @summary Queries the queries that are being executed on a cluster.
 *
 * @param request DescribeProcessListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeProcessListResponse
 */
async function describeProcessListWithOptions(request: DescribeProcessListRequest, runtime: Util.RuntimeOptions): DescribeProcessListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.runningTime)) {
    query['RunningTime'] = request.runningTime;
  }
  if (!Util.isUnset(request.showFull)) {
    query['ShowFull'] = request.showFull;
  }
  if (!Util.isUnset(request.user)) {
    query['User'] = request.user;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeProcessList',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the queries that are being executed on a cluster.
 *
 * @param request DescribeProcessListRequest
 * @return DescribeProcessListResponse
 */
async function describeProcessList(request: DescribeProcessListRequest): DescribeProcessListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeProcessListWithOptions(request, runtime);
}

model DescribeRdsAnalysisResourceQuotasRequest {
  clusterCategory?: string(name='ClusterCategory', description='The edition of the MySQL analytic instance.', example='mixed_storage'),
  clusterMode?: string(name='ClusterMode', description='The mode of the MySQL analytic instance.', example='flexible'),
  nodeClass?: string(name='NodeClass', description='The instance type of the MySQL analytic instance.', example='E32'),
  nodeCount?: int32(name='NodeCount', description='The number of nodes in the MySQL analytic instance.', example='5'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  rdsInstanceId?: string(name='RdsInstanceId', description='The ID of the ApsaraDB RDS instance from which data is synchronized to the MySQL analytic instance.', example='rm-2ze09tofcv39h7165'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-4690g37929****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  storageType?: string(name='StorageType', description='The storage type of the MySQL analytic instance.', example='cloud_essd'),
}

model DescribeRdsAnalysisResourceQuotasResponseBody = {
  DBNodeCategoryList?: {
    DBNodeCategory?: [ 
    {
      text?: string(name='Text', description='The display value.', example='mixed_storage'),
      value?: string(name='Value', description='The real value.', example='mixed_storage'),
    }
  ](name='DBNodeCategory')
  }(name='DBNodeCategoryList', description='The editions of the MySQL analytic instances.'),
  DBNodeClassList?: {
    DBNodeClass?: [ 
    {
      text?: string(name='Text', description='The display value.', example='E32'),
      value?: string(name='Value', description='The real value.', example='E32'),
    }
  ](name='DBNodeClass')
  }(name='DBNodeClassList', description='The instance types of the MySQL analytic instances.'),
  DBNodeStorageList?: {
    DBNodeStorage?: [ 
    {
      text?: string(name='Text', description='The display value.', example='100'),
      value?: string(name='Value', description='The real value.', example='100'),
    }
  ](name='DBNodeStorage')
  }(name='DBNodeStorageList', description='The storage sizes of the MySQL analytic instances.'),
  engineVersionList?: {
    engineVersion?: [ 
    {
      text?: string(name='Text', description='The display value.', example='3.0'),
      value?: string(name='Value', description='The real value.', example='3.0'),
    }
  ](name='EngineVersion')
  }(name='EngineVersionList', description='The versions of the MySQL analytic instances.'),
  modeList?: {
    mode?: [ 
    {
      text?: string(name='Text', description='The display value.', example='flexible'),
      value?: string(name='Value', description='The real value.', example='flexible'),
    }
  ](name='Mode')
  }(name='ModeList', description='The modes of the MySQL analytic instances.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1A31D7FA-1826-5843-8807-D2F715E70CB0'),
  storageTypeList?: {
    storageType?: [ 
    {
      text?: string(name='Text', description='The display value.', example='cloud_essd'),
      value?: string(name='Value', description='The real value.', example='cloud_essd'),
    }
  ](name='StorageType')
  }(name='StorageTypeList', description='The storage types of the MySQL analytic instances.'),
}

model DescribeRdsAnalysisResourceQuotasResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRdsAnalysisResourceQuotasResponseBody(name='body'),
}

/**
 * @summary Queries the information about specifications of MySQL analytic instances.
 *
 * @param request DescribeRdsAnalysisResourceQuotasRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRdsAnalysisResourceQuotasResponse
 */
async function describeRdsAnalysisResourceQuotasWithOptions(request: DescribeRdsAnalysisResourceQuotasRequest, runtime: Util.RuntimeOptions): DescribeRdsAnalysisResourceQuotasResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterCategory)) {
    query['ClusterCategory'] = request.clusterCategory;
  }
  if (!Util.isUnset(request.clusterMode)) {
    query['ClusterMode'] = request.clusterMode;
  }
  if (!Util.isUnset(request.nodeClass)) {
    query['NodeClass'] = request.nodeClass;
  }
  if (!Util.isUnset(request.nodeCount)) {
    query['NodeCount'] = request.nodeCount;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.rdsInstanceId)) {
    query['RdsInstanceId'] = request.rdsInstanceId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.storageType)) {
    query['StorageType'] = request.storageType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRdsAnalysisResourceQuotas',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about specifications of MySQL analytic instances.
 *
 * @param request DescribeRdsAnalysisResourceQuotasRequest
 * @return DescribeRdsAnalysisResourceQuotasResponse
 */
async function describeRdsAnalysisResourceQuotas(request: DescribeRdsAnalysisResourceQuotasRequest): DescribeRdsAnalysisResourceQuotasResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRdsAnalysisResourceQuotasWithOptions(request, runtime);
}

model DescribeRegionsRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='Th language of the `LocalName` response parameter. Valid values:

*   **zh-CN**: Chinese.
*   **en-US**: English.
*   **ja**: Japanese.

> If you do not specify this parameter, the Chinese language is used.', example='en-US'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/612293.html) operation to query the most recent region list.', example='cn-shenzhen'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeRegionsResponseBody = {
  regions?: {
    region?: [ 
    {
      localName?: string(name='LocalName', description='The region name.', example='China (Hangzhou)'),
      regionEndpoint?: string(name='RegionEndpoint', description='The endpoint of the region.', example='adb.aliyuncs.com'),
      regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
      zones?: {
        zone?: [ 
        {
          localName?: string(name='LocalName', description='The zone name.', example='Hangzhou Zone H'),
          vpcEnabled?: boolean(name='VpcEnabled', description='Indicates whether Virtual Private Cloud (VPC) is supported in the zone. Valid values:

*   **true**
*   **false**', example='true'),
          zoneId?: string(name='ZoneId', description='The zone ID.', example='cn-hangzhou-h'),
        }
      ](name='Zone')
      }(name='Zones', description='The queried zones.'),
    }
  ](name='Region')
  }(name='Regions', description='The queried regions.'),
  requestId?: string(name='RequestId', description='The request ID.', example='421794A3-72A5-5D27-9E8B-A75A4C503E17'),
}

model DescribeRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRegionsResponseBody(name='body'),
}

/**
 * @summary Queries a list of available regions and zones for AnalyticDB for MySQL.
 *
 * @param request DescribeRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRegionsResponse
 */
async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: Util.RuntimeOptions): DescribeRegionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRegions',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of available regions and zones for AnalyticDB for MySQL.
 *
 * @param request DescribeRegionsRequest
 * @return DescribeRegionsResponse
 */
async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRegionsWithOptions(request, runtime);
}

model DescribeRegionsMixedRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeRegionsMixedResponseBody = {
  regions?: {
    region?: [ 
    {
      regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
      version?: string(name='Version', description='The version of the cluster.

Valid values:

*   2.0
*   3.0', example='3.0'),
    }
  ](name='Region')
  }(name='Regions', description='The queried regions.'),
  requestId?: string(name='RequestId', description='The request ID.', example='2E9450FF-F8AD-54C6-B3C3-009FBD7C0700'),
}

model DescribeRegionsMixedResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRegionsMixedResponseBody(name='body'),
}

/**
 * @summary Queries information about regions.
 *
 * @param request DescribeRegionsMixedRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRegionsMixedResponse
 */
async function describeRegionsMixedWithOptions(request: DescribeRegionsMixedRequest, runtime: Util.RuntimeOptions): DescribeRegionsMixedResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRegionsMixed',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries information about regions.
 *
 * @param request DescribeRegionsMixedRequest
 * @return DescribeRegionsMixedResponse
 */
async function describeRegionsMixed(request: DescribeRegionsMixedRequest): DescribeRegionsMixedResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRegionsMixedWithOptions(request, runtime);
}

model DescribeResubmitConfigRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a region.

This parameter is required.', example='am-8vbyw9awuj141haf9'),
  groupName?: string(name='GroupName', description='The name of the resource group.

>  You can call the [DescribeDBResourceGroup](https://help.aliyun.com/document_detail/459446.html) operation to query the resource group name of a cluster.

This parameter is required.', example='test_group'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-4690g37929XXXX'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeResubmitConfigResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a region.', example='am-8vbyw9awuj141haf9'),
  requestId?: string(name='RequestId', description='The request ID.', example='8D217417-BBA7-566C-9B9D-FFCBC86112B0'),
  rules?: [ 
    {
      exceedMemoryException?: boolean(name='ExceedMemoryException', description='Indicates whether out-of-memory (OOM) check is configured.', example='false'),
      groupName?: string(name='GroupName', description='The name of the source resource group.', example='test_group'),
      peakMemory?: string(name='PeakMemory', description='The peak memory usage.', example='32'),
      queryTime?: string(name='QueryTime', description='The duration of the SQL statement. Unit: milliseconds.', example='300'),
      targetGroupName?: string(name='TargetGroupName', description='The name of the destination resource group.', example='test_target_group'),
    }
  ](name='Rules', description='The job resubmission rules.'),
}

model DescribeResubmitConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeResubmitConfigResponseBody(name='body'),
}

/**
 * @summary 查询Resubmit配置
 *
 * @param request DescribeResubmitConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeResubmitConfigResponse
 */
async function describeResubmitConfigWithOptions(request: DescribeResubmitConfigRequest, runtime: Util.RuntimeOptions): DescribeResubmitConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeResubmitConfig',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询Resubmit配置
 *
 * @param request DescribeResubmitConfigRequest
 * @return DescribeResubmitConfigResponse
 */
async function describeResubmitConfig(request: DescribeResubmitConfigRequest): DescribeResubmitConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeResubmitConfigWithOptions(request, runtime);
}

model DescribeSQAConfigRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='am-8vbyw9awuj141haf9'),
  groupName?: string(name='GroupName', description='The name of the resource group.

>  You can call the [DescribeDBResourceGroup](https://help.aliyun.com/document_detail/612410.html) operation to query the resource group name of a cluster.

This parameter is required.', example='test'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-4690g37929****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeSQAConfigResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.', example='am-8vbyw9awuj141haf9'),
  groupName?: string(name='GroupName', description='The name of the resource group.', example='test_group'),
  requestId?: string(name='RequestId', description='The request ID.', example='CBE843D8-964D-5EA3-9D31-822125611B6E'),
  SQAStatus?: string(name='SQAStatus', description='Indicates whether short query acceleration (SQA) is enabled.', example='off'),
}

model DescribeSQAConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSQAConfigResponseBody(name='body'),
}

/**
 * @summary 查询SQA状态
 *
 * @param request DescribeSQAConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSQAConfigResponse
 */
async function describeSQAConfigWithOptions(request: DescribeSQAConfigRequest, runtime: Util.RuntimeOptions): DescribeSQAConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSQAConfig',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询SQA状态
 *
 * @param request DescribeSQAConfigRequest
 * @return DescribeSQAConfigResponse
 */
async function describeSQAConfig(request: DescribeSQAConfigRequest): DescribeSQAConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSQAConfigWithOptions(request, runtime);
}

model DescribeSQLPatternsRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters in a region, including cluster IDs.

This parameter is required.', example='am-bp1r053byu48p****'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time must be in UTC.

> The end time must be later than the start time.

This parameter is required.', example='2021-09-30T00:15:00Z'),
  keyword?: string(name='Keyword', description='The keyword that is used for the query.', example='SELECT'),
  lang?: string(name='Lang', description='The language of file titles and error messages. Valid values:

*   **zh** (default): simplified Chinese.
*   **en**: English.
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  order?: string(name='Order', description='The order by which to sort query results. Specify the parameter value in the JSON format. Example: `[{"Field":"AverageQueryTime","Type":"Asc"}]`.

*   `Field` specifies the field by which to sort the query results. Valid values:

    *   `PatternCreationTime`: the earliest commit time of the SQL pattern within the time range to query.
    *   `AverageQueryTime`: the average total amount of time consumed by the SQL pattern within the time range to query.
    *   `MaxQueryTime`: the maximum total amount of time consumed by the SQL pattern within the time range to query.
    *   `AverageExecutionTime`: the average execution duration of the SQL pattern within the time range to query.
    *   `MaxExecutionTime`: the maximum execution duration of the SQL pattern within the time range to query.
    *   `AveragePeakMemory`: the average peak memory usage of the SQL pattern within the time range to query.
    *   `MaxPeakMemory`: the maximum peak memory usage of the SQL pattern within the time range to query.
    *   `AverageScanSize`: the average amount of data scanned based on the SQL pattern within the time range to query.
    *   `MaxScanSize`: the maximum amount of data scanned based on the SQL pattern within the time range to query.
    *   `QueryCount`: the number of queries performed in association with the SQL pattern within the time range to query.
    *   `FailedCount`: the number of failed queries performed in association with the SQL pattern within the time range to query.

*   `Type` specifies the sorting order. Valid values (case-insensitive):

    *   `Asc`: ascending order.
    *   `Desc`: descending order.

This parameter is required.', example='[{"Field":"AverageQueryTime","Type":"Asc"}]'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1.

> If you do not specify this parameter, the value **1** is used.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   **30**
*   **50**
*   **100**

> If you do not specify this parameter, the value **30** is used.', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time must be in UTC.

> 

*   Only data within the last 14 days can be queried. For example, if the current time is 2021-11-22T12:00:00Z, you can query SQL patterns at a point in time as early as 2021-11-09T12:00:00Z.

*   The maximum time range that can be specified is 24 hours.

This parameter is required.', example='2021-09-30T00:10:00Z'),
}

model DescribeSQLPatternsResponseBody = {
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='30'),
  patternDetails?: [ 
    {
      accessIp?: string(name='AccessIp', description='The IP address of the SQL client that commits the SQL pattern.', example='192.168.xx.xx'),
      averageExecutionTime?: double(name='AverageExecutionTime', description='The average execution duration of the SQL pattern within the query time range. Unit: milliseconds.', example='234.78'),
      averageOperatorCost?: double(name='AverageOperatorCost', description='The average operation duration.', example='5'),
      averagePeakMemory?: double(name='AveragePeakMemory', description='The average peak memory usage of the SQL pattern within the query time range. Unit: bytes.', example='234.22'),
      averageQueryTime?: double(name='AverageQueryTime', description='The average total amount of time consumed by the SQL pattern within the query time range. Unit: milliseconds.', example='4'),
      averageScanCost?: double(name='AverageScanCost', description='The average scan duration.', example='3'),
      averageScanSize?: double(name='AverageScanSize', description='The average amount of data scanned based on the SQL pattern within the query time range. Unit: bytes.', example='234149.23'),
      blockable?: boolean(name='Blockable', description='Indicates whether the execution of the SQL pattern can be blocked. Valid values:

*   **true**
*   **false**

> Only SELECT and INSERT statements can be blocked.', example='true'),
      failedCount?: long(name='FailedCount', description='The number of failed queries executed in association with the SQL pattern within the query time range.', example='234'),
      maxExecutionTime?: long(name='MaxExecutionTime', description='The maximum execution duration of the SQL pattern within the query time range. Unit: milliseconds.', example='2142'),
      maxOperatorCost?: double(name='MaxOperatorCost', description='The maximum operation duration.', example='10'),
      maxPeakMemory?: long(name='MaxPeakMemory', description='The maximum peak memory usage of the SQL pattern within the query time range. Unit: bytes.', example='234149'),
      maxQueryTime?: long(name='MaxQueryTime', description='The maximum total amount of time consumed by the SQL pattern within the query time range. Unit: milliseconds.', example='2341'),
      maxScanCost?: double(name='MaxScanCost', description='The maximum scan duration.', example='7'),
      maxScanSize?: long(name='MaxScanSize', description='The maximum amount of data scanned based on the SQL pattern within the query time range. Unit: bytes.', example='234149'),
      operatorCostPercentage?: double(name='OperatorCostPercentage', description='The operation duration percentage.', example='75'),
      operatorCostSum?: double(name='OperatorCostSum', description='The total operation duration.', example='20'),
      patternCreationTime?: string(name='PatternCreationTime', description='The earliest commit time of the SQL pattern within the query time range. Unit: milliseconds.', example='2021-11-12 03:06:00'),
      patternId?: string(name='PatternId', description='The ID of the SQL pattern.', example='5575924945138******'),
      peakMemoryPercentage?: double(name='PeakMemoryPercentage', description='The peak memory percentage.', example='80'),
      peakMemorySum?: double(name='PeakMemorySum', description='The total peak memory.', example='3600'),
      queryCount?: long(name='QueryCount', description='The number of queries executed in association with the SQL pattern within the query time range.', example='345'),
      queryTimePercentage?: double(name='QueryTimePercentage', description='The queue duration of the SQL statement. Unit: milliseconds.', example='80'),
      queryTimeSum?: double(name='QueryTimeSum', description='The total query duration.', example='5'),
      SQLPattern?: string(name='SQLPattern', description='The statement of the SQL pattern.', example='SELECT * FROM KEPLER_META_NODE_STATIC_INFO WHERE elastic_node = ? OR (elastic_node = ? AND enable = ?)'),
      scanCostPercentage?: double(name='ScanCostPercentage', description='The scan duration percentage.', example='75'),
      scanCostSum?: double(name='ScanCostSum', description='The total scan duration.', example='11'),
      scanSizePercentage?: double(name='ScanSizePercentage', description='The amount of time consumed to scan data from a data source in the task. Unit: milliseconds.', example='80'),
      scanSizeSum?: double(name='ScanSizeSum', description='Total total scan size.', example='3'),
      tables?: string(name='Tables', description='The tables scanned based on the SQL pattern.', example='tpch.orders'),
      user?: string(name='User', description='The database username that is used to commit the SQL pattern.', example='reporter'),
    }
  ](name='PatternDetails', description='The queried SQL patterns.'),
  requestId?: string(name='RequestId', description='The request ID.', example='6BE0EDD1-0DE6-3EB6-81BF-BFE4F2******'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model DescribeSQLPatternsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSQLPatternsResponseBody(name='body'),
}

/**
 * @summary Queries a list of SQL patterns for an AnalyticDB for MySQL cluster within a period of time.
 *
 * @param request DescribeSQLPatternsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSQLPatternsResponse
 */
async function describeSQLPatternsWithOptions(request: DescribeSQLPatternsRequest, runtime: Util.RuntimeOptions): DescribeSQLPatternsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSQLPatterns',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of SQL patterns for an AnalyticDB for MySQL cluster within a period of time.
 *
 * @param request DescribeSQLPatternsRequest
 * @return DescribeSQLPatternsResponse
 */
async function describeSQLPatterns(request: DescribeSQLPatternsRequest): DescribeSQLPatternsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSQLPatternsWithOptions(request, runtime);
}

model DescribeSQLPlanRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-****************'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  processId?: string(name='ProcessId', description='The query ID.

>  You can call the [DescribeProcessList](https://help.aliyun.com/document_detail/612277.html) operation to query the IDs of queries that are being executed.

This parameter is required.', example='202105271604431720161662490345*******'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeSQLPlanResponseBody = {
  detail?: {
    CPUTime?: long(name='CPUTime', description='The total CPU time consumed by all operators on multithreaded servers when the SQL statement is executed. Unit: milliseconds.', example='6100'),
    clientIP?: string(name='ClientIP', description='The IP address of the client that is used to execute the SQL statement.', example='172.16.***.***'),
    database?: string(name='Database', description='The name of the database on which the SQL statement was executed.', example='adb_demo'),
    outputRows?: long(name='OutputRows', description='The total number of rows generated by the SQL statement.', example='1'),
    outputSize?: long(name='OutputSize', description='The total amount of data generated by the SQL statement. Unit: bytes.', example='9'),
    peakMemory?: long(name='PeakMemory', description='The maximum memory usage when the SQL statement is executed. Unit: bytes.', example='441802'),
    planningTime?: long(name='PlanningTime', description='The amount of time consumed to generate the execution plan of the SQL statement. Unit: milliseconds.', example='86'),
    queuedTime?: long(name='QueuedTime', description='The amount of time consumed to queue the SQL statement. Unit: milliseconds.', example='0'),
    SQL?: string(name='SQL', description='The SQL statement.', example='INSERT OVERWRITE INTO hdfs_import_external\\\\nSELECT *\\\\nFROM adb_hdfs_import_source'),
    startTime?: string(name='StartTime', description='The execution start time of the SQL statement. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1622102683243'),
    state?: string(name='State', description='The final execution state of the SQL statement. Valid values:

*   FINISHED
*   FAILED', example='FINISHED'),
    totalStage?: long(name='TotalStage', description='The total number of stages in the SQL statement.', example='4'),
    totalTask?: long(name='TotalTask', description='The total number of tasks in the SQL statement.', example='4'),
    totalTime?: long(name='TotalTime', description='The total amount of time consumed to execute the SQL statement. Unit: milliseconds.', example='2340'),
    user?: string(name='User', description='The name of the user who submitted the SQL statement.', example='test_acc'),
  }(name='Detail', description='The execution information about the SQL statement.'),
  originInfo?: string(name='OriginInfo', description='The original information about the SQL statement.', example='{\\\\"queryId\\\\":\\\\"20210527_160443_10581_hdhzr\\\\",\\\\"session\\\\":{\\\\"queryId\\\\":\\\\"20210527_160443_10581_hdhzr\\\\",\\\\"hasSharedStage\\\\":false,\\\\"parentId\\\\":0}}'),
  requestId?: string(name='RequestId', description='The request ID.', example='22D6DEF0-CBC7-4388-A41C-D5FD62******'),
  stageList?: [ 
    {
      CPUTimeAvg?: long(name='CPUTimeAvg', description='The average `CPU Time` value on each compute node in the stage. Unit: milliseconds.', example='5984'),
      CPUTimeMax?: long(name='CPUTimeMax', description='The maximum `CPU Time` value on each compute node in the stage. Unit: milliseconds.', example='5984'),
      CPUTimeMin?: long(name='CPUTimeMin', description='The minimum `CPU Time` value on each compute node in the stage. Unit: milliseconds.', example='47'),
      inputSizeAvg?: long(name='InputSizeAvg', description='The average amount of input data on each compute node in the stage. Unit: bytes.', example='173'),
      inputSizeMax?: long(name='InputSizeMax', description='The maximum amount of input data on each compute node in the stage. Unit: byte.', example='173'),
      inputSizeMin?: long(name='InputSizeMin', description='The minimum amount of input data on each compute node in the stage. Unit: bytes.', example='173'),
      operatorCost?: long(name='OperatorCost', description='The total CPU time consumed by all operators in the stage, which is equivalent to the total CPU time of the stage. You can use this parameter to determine which parts of the stage consume a large amount of computing resources. Unit: milliseconds.', example='5984'),
      peakMemory?: long(name='PeakMemory', description='The maximum memory usage when the SQL statement is executed. Unit: bytes.', example='74208'),
      scanSizeAvg?: long(name='ScanSizeAvg', description='The average amount of data scanned by a scan operator on each storage node in the stage. Unit: bytes.', example='0'),
      scanSizeMax?: long(name='ScanSizeMax', description='The maximum amount of data scanned by a scan operator on each storage node in the stage. Unit: bytes.', example='0'),
      scanSizeMin?: long(name='ScanSizeMin', description='The minimum amount of data scanned by a scan operator on each storage node in the stage. Unit: bytes.', example='0'),
      scanTimeAvg?: long(name='ScanTimeAvg', description='The average amount of time consumed by a scan operator to read data on each storage node in the stage. Unit: milliseconds.', example='0'),
      scanTimeMax?: long(name='ScanTimeMax', description='The maximum amount of time consumed by a scan operator to read data on each storage node in the stage. Unit: milliseconds.', example='0'),
      scanTimeMin?: long(name='ScanTimeMin', description='The minimum amount of time consumed by a scan operator to read data on each storage node in the stage. Unit: milliseconds.', example='0'),
      stageId?: int32(name='StageId', description='The stage ID.', example='1'),
      state?: string(name='State', description='The final execution state of the stage. Valid values:

*   FINISHED
*   CANCELED
*   ABORTED
*   FAILED', example='FINISHED'),
    }
  ](name='StageList', description='The queried plan in different stages.'),
}

model DescribeSQLPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSQLPlanResponseBody(name='body'),
}

/**
 * @summary Queries the plan information about an SQL statement such as a query statement or an extract-transform-load (ETL) task statement.
 *
 * @param request DescribeSQLPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSQLPlanResponse
 */
async function describeSQLPlanWithOptions(request: DescribeSQLPlanRequest, runtime: Util.RuntimeOptions): DescribeSQLPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.processId)) {
    query['ProcessId'] = request.processId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSQLPlan',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the plan information about an SQL statement such as a query statement or an extract-transform-load (ETL) task statement.
 *
 * @param request DescribeSQLPlanRequest
 * @return DescribeSQLPlanResponse
 */
async function describeSQLPlan(request: DescribeSQLPlanRequest): DescribeSQLPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSQLPlanWithOptions(request, runtime);
}

model DescribeSQLPlanTaskRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  processId?: string(name='ProcessId', description='The task ID.

This parameter is required.', example='201907241445301720211111570315107****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  stageId?: string(name='StageId', description='The stage of the task.

This parameter is required.', example='1785135913****'),
}

model DescribeSQLPlanTaskResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  taskList?: [ 
    {
      elapsedTime?: long(name='ElapsedTime', description='The time elapsed from when the task was created to when the task was complete. Unit: milliseconds.', example='10'),
      inputRows?: long(name='InputRows', description='The number of input rows in the task.', example='105'),
      inputSize?: long(name='InputSize', description='The amount of input data in the task. Unit: bytes.', example='3763'),
      operatorCost?: long(name='OperatorCost', description='The total amount of time consumed by all operators in the task on a specific node. This parameter can be used to determine whether long tails occur in computing. Unit: milliseconds.', example='3'),
      outputRows?: long(name='OutputRows', description='The number of output rows in the task.', example='105'),
      outputSize?: long(name='OutputSize', description='The amount of output data in the task. Unit: bytes.', example='945'),
      peakMemory?: long(name='PeakMemory', description='The peak memory of the task on a specific node. Unit: bytes.', example='898576'),
      scanCost?: long(name='ScanCost', description='The amount of time consumed to scan data from a data source in the task. Unit: milliseconds.', example='0'),
      scanRows?: long(name='ScanRows', description='The number of rows scanned from a data source in the task.', example='0'),
      scanSize?: long(name='ScanSize', description='The amount of data scanned from a data source in the task. Unit: bytes.', example='0'),
      state?: string(name='State', description='The final execution status of the task. Valid values:

*   FINISHED
*   CANCELED
*   ABORTED
*   FAILED', example='FINISHED'),
      taskId?: int32(name='TaskId', description='The task ID.', example='198877623'),
    }
  ](name='TaskList', description='The queried task.'),
}

model DescribeSQLPlanTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSQLPlanTaskResponseBody(name='body'),
}

/**
 * @summary Queries the information about a task.
 *
 * @param request DescribeSQLPlanTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSQLPlanTaskResponse
 */
async function describeSQLPlanTaskWithOptions(request: DescribeSQLPlanTaskRequest, runtime: Util.RuntimeOptions): DescribeSQLPlanTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.processId)) {
    query['ProcessId'] = request.processId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.stageId)) {
    query['StageId'] = request.stageId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSQLPlanTask',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a task.
 *
 * @param request DescribeSQLPlanTaskRequest
 * @return DescribeSQLPlanTaskResponse
 */
async function describeSQLPlanTask(request: DescribeSQLPlanTaskRequest): DescribeSQLPlanTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSQLPlanTaskWithOptions(request, runtime);
}

model DescribeSchemasRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeSchemasResponseBody = {
  items?: {
    schema?: [ 
    {
      DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-bp1xxxxxxxx47'),
      schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
    }
  ](name='Schema')
  }(name='Items', description='The queried databases.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeSchemasResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSchemasResponseBody(name='body'),
}

/**
 * @summary Queries a list of databases in an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeSchemasRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSchemasResponse
 */
async function describeSchemasWithOptions(request: DescribeSchemasRequest, runtime: Util.RuntimeOptions): DescribeSchemasResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSchemas',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of databases in an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeSchemasRequest
 * @return DescribeSchemasResponse
 */
async function describeSchemas(request: DescribeSchemasRequest): DescribeSchemasResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSchemasWithOptions(request, runtime);
}

model DescribeSlowLogRecordsRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the cluster IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a specific region.

This parameter is required.', example='am-bp1rqvm70uh2****'),
  DBName?: string(name='DBName', description='The name of the database.', example='adb_demo'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time must be in UTC.

>  The end time must be later than the start time. The specified time range must be less than seven days.

This parameter is required.', example='2021-05-27T16:00:00Z'),
  order?: string(name='Order', description='The order in which to sort the retrieved entries by field. Specify this parameter in the JSON format. The value is an ordered array that uses the order of the input array and contains `Field` and `Type`. Example: `[{"Field":"ExecutionStartTime","Type":"Desc"},{"Field":"ScanRows","Type":"Asc"}]`.

*   `Field`: the field that is used to sort the retrieved entries. Valid values:

    *   **HostAddress**: the IP address of the client that is used to connect to the database.
    *   **UserName**: the username.
    *   **ExecutionStartTime**: the start time of the query execution.
    *   **QueryTime**: the amount of time consumed to execute the SQL statement.
    *   **PeakMemoryUsage**: the maximum memory usage when the SQL statement is executed.
    *   **ScanRows**: the number of rows to be scanned from a data source in the task.
    *   **ScanSize**: the amount of data to be scanned.
    *   **ScanTime**: the total amount of time consumed to scan data.
    *   **PlanningTime**: the amount of time consumed to generate execution plans.
    *   **WallTime**: the accumulated CPU Time values of all operators in the query on each node.
    *   **ProcessID**: the ID of the process.

*   `Type`: the sorting type of the retrieved entries. Valid values:

    *   **Desc**: descending order
    *   **Asc**: ascending order', example='[{"Field":"ExecutionStartTime","Type":"Desc"},{"Field":"ScanRows","Type":"Asc"}]'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. The value must be an integer that is greater than 0. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: **30**, **50**, and **100**. Default value: 30.', example='30'),
  processID?: string(name='ProcessID', description='The ID of the process.', example='2021052716044317201616624903453******'),
  range?: string(name='Range', description='The range conditions used to filter specified fields, including `Max` and `Min`. Specify this parameter in the JSON format. Example: `[{"Field":"ScanSize","Min":"1000000","Max":"10000000"},{"Field":"QueryTime","Min":"1000","Max":"10000"}]`.

`Field`: the field to be filtered. Valid values:

*   **ScanSize**: the amount of data to be scanned. Unit: KB.
*   **QueryTime**: the amount of time consumed to execute the statement. Unit: milliseconds.
*   **PeakMemoryUsage**: the maximum memory usage when the SQL statement is executed. Unit: KB.

>  `Min` indicates the minimum value of the query range (left operand). `Max` indicates the maximum value of the query range (right operand). Max and Min are both of the String type.', example='[{"Field":"ScanSize","Min":"1000000","Max":"10000000"},{"Field":"QueryTime","Min":"1000","Max":"10000"}]'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time must be in UTC.

This parameter is required.', example='2021-05-20T16:00:00Z'),
  state?: string(name='State', description='The state of the query. Valid values:

*   **Successed**: successful
*   **Failed**: failed', example='Successed'),
}

model DescribeSlowLogRecordsResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.', example='am-bp1rqvm70uh2****'),
  items?: {
    slowLogRecord?: [ 
    {
      DBName?: string(name='DBName', description='The name of the database.', example='adb_demo'),
      executionStartTime?: string(name='ExecutionStartTime', description='The time when the execution started. The time follows the ISO 8601 standard in the *yyyy-MM-ddTHH:mm:ssZ* format. The time is displayed in UTC.', example='2021-05-27T08:04:43Z'),
      hostAddress?: string(name='HostAddress', description='The IP address of the client that is used to connect to the database.', example='``172.16.**.**``'),
      outputSize?: string(name='OutputSize', description='The amount of output data in the task. Unit: bytes.', example='0.009'),
      parseRowCounts?: long(name='ParseRowCounts', description='The number of rows parsed by the SQL statement.', example='0'),
      peakMemoryUsage?: string(name='PeakMemoryUsage', description='The maximum memory usage when the SQL statement is executed. Unit: KB.', example='431.447'),
      planningTime?: long(name='PlanningTime', description='The amount of time consumed to generate execution plans. Unit: milliseconds.', example='12'),
      processID?: string(name='ProcessID', description='The ID of the process.', example='2021052716044317201616624903453******'),
      queryTime?: long(name='QueryTime', description='The time consumed to execute the SQL statement. Unit: milliseconds.', example='2344'),
      queueTime?: long(name='QueueTime', description='The queuing duration before the query is executed. Unit: milliseconds.', example='0'),
      returnRowCounts?: long(name='ReturnRowCounts', description='The number of rows returned by the SQL statement.', example='1'),
      SQLText?: string(name='SQLText', description='Details of the SQL statement.', example='INSERT OVERWRITE INTO hdfs_import_external\\\\nSELECT *\\\\nFROM adb_hdfs_import_source'),
      scanRows?: long(name='ScanRows', description='The number of rows scanned from a data source in the task.', example='3'),
      scanSize?: string(name='ScanSize', description='The amount of scanned data. Unit: KB.', example='0.035'),
      scanTime?: long(name='ScanTime', description='The total amount of time consumed to scan data. It is an accumulated value collected from multiple TableScanNode nodes. Unit: milliseconds.', example='10'),
      state?: string(name='State', description='The execution state of the SQL statement.', example='SUCCESSED'),
      userName?: string(name='UserName', description='The username.', example='test'),
      wallTime?: long(name='WallTime', description='The accumulated CPU Time value of all operators collected from all nodes. Unit: milliseconds.', example='6100'),
    }
  ](name='SlowLogRecord')
  }(name='Items', description='Details of the slow query logs.'),
  pageNumber?: string(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries returned on the current page.', example='30'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='D7559209-7EC3-41E1-8F78-156990******'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='100'),
}

model DescribeSlowLogRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSlowLogRecordsResponseBody(name='body'),
}

/**
 * @summary 查看慢日志
 *
 * @param request DescribeSlowLogRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSlowLogRecordsResponse
 */
async function describeSlowLogRecordsWithOptions(request: DescribeSlowLogRecordsRequest, runtime: Util.RuntimeOptions): DescribeSlowLogRecordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.DBName)) {
    query['DBName'] = request.DBName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.processID)) {
    query['ProcessID'] = request.processID;
  }
  if (!Util.isUnset(request.range)) {
    query['Range'] = request.range;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.state)) {
    query['State'] = request.state;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSlowLogRecords',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查看慢日志
 *
 * @param request DescribeSlowLogRecordsRequest
 * @return DescribeSlowLogRecordsResponse
 */
async function describeSlowLogRecords(request: DescribeSlowLogRecordsRequest): DescribeSlowLogRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSlowLogRecordsWithOptions(request, runtime);
}

model DescribeSqlPatternRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-bp1r053byu48p****'),
  order?: string(name='Order', description='The order by which to sort query results. Specify the parameter value in the JSON string format. Example: `[{"Field":"Pattern","Type":"Asc"}]`. Parameters:

*   `Field` specifies the field by which to sort the query results. Valid values:

    *   `Pattern`: the SQL pattern.
    *   `AccessIP`: the IP address of the client.
    *   `User`: the username.
    *   `QueryCount`: the number of queries performed in association with the SQL pattern within the time range to query.
    *   `AvgPeakMemory`: the average peak memory usage of the SQL pattern within the time range to query. Unit: KB.
    *   `MaxPeakMemory`: the maximum peak memory usage of the SQL pattern within the time range to query. Unit: KB.
    *   `AvgCpuTime`: the average execution duration of the SQL pattern within the time range to query. Unit: milliseconds.
    *   `MaxCpuTime`: the maximum execution duration of the SQL pattern within the time range to query. Unit: milliseconds.
    *   `AvgStageCount`: the average number of stages.
    *   `MaxStageCount`: the maximum number of stages.
    *   `AvgTaskCount`: the average number of tasks.
    *   `MaxTaskCount`: the maximum number of tasks.
    *   `AvgScanSize`: the average amount of data scanned based on the SQL pattern within the time range to query. Unit: KB.
    *   `MaxScanSize`: the maximum amount of data scanned based on the SQL pattern within the time range to query. Unit: KB.

*   `Type` specifies the sorting order. Valid values:

    *   `Asc`: ascending order.
    *   `Desc`: descending order.

> 

*   If you do not specify this parameter, query results are sorted in ascending order of `Pattern`.

*   If you want to sort query results by `AccessIP`, you must set the `Type` parameter to `accessip`. If you want to sort query results by `User`, you must leave the `Type` parameter empty or set it to `user`.', example='[{"Field":"Pattern","Type":"Asc"}]'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. The value must be a positive integer. Default value: **30**.', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  sqlPattern?: string(name='SqlPattern', description='The keyword that is used for the query.

> If you do not specify this parameter, all SQL patterns of the AnalyticDB for MySQL cluster within the time period specified by `StartTime` are returned.', example='SELECT'),
  startTime?: string(name='StartTime', description='The start date to query. Specify the time in the *yyyy-MM-dd* format. The time must be in UTC.

> Only data within the last 30 days can be queried.

This parameter is required.', example='2021-08-30'),
  type?: string(name='Type', description='The dimension by which to aggregate the SQL patterns. Valid values:

*   `user`: aggregates the SQL patterns by user.
*   `accessip`: aggregates the SQL patterns by client IP address.

> If you do not specify this parameter, the SQL patterns are aggregated by `user`.', example='user'),
}

model DescribeSqlPatternResponseBody = {
  items?: [ 
    {
      accessIP?: string(name='AccessIP', description='The IP address of the client.

> This parameter is returned only when `Type` is set to `accessip`.', example='100.104.***.***'),
      avgCpuTime?: string(name='AvgCpuTime', description='The average execution duration of the SQL pattern within the time range to query. Unit: milliseconds.', example='1.0625'),
      avgPeakMemory?: string(name='AvgPeakMemory', description='The average peak memory usage of the SQL pattern within the query time range. Unit: KB.', example='240048'),
      avgScanSize?: string(name='AvgScanSize', description='The average amount of data scanned based on the SQL pattern within the query time range. Unit: KB.', example='0'),
      avgStageCount?: string(name='AvgStageCount', description='The average number of stages.', example='2'),
      avgTaskCount?: string(name='AvgTaskCount', description='The average number of tasks.', example='2'),
      instanceName?: string(name='InstanceName', description='The cluster ID.', example='am-bp1r053byu48p****'),
      maxCpuTime?: string(name='MaxCpuTime', description='The maximum execution duration of the SQL pattern within the time range to query. Unit: milliseconds.', example='17'),
      maxPeakMemory?: string(name='MaxPeakMemory', description='The maximum peak memory usage of the SQL pattern within the query time range. Unit: KB.', example='480096'),
      maxScanSize?: string(name='MaxScanSize', description='The maximum amount of data scanned based on the SQL pattern within the query time range. Unit: KB.', example='0'),
      maxStageCount?: string(name='MaxStageCount', description='The maximum number of stages.', example='2'),
      maxTaskCount?: string(name='MaxTaskCount', description='The maximum number of tasks.', example='2'),
      pattern?: string(name='Pattern', description='The SQL pattern.', example='SELECT table_name, table_schema AS schema_name, create_time, create_time AS last_ddl_time, table_comment AS description , ceil((data_length + index_length) / ? / ?) AS store_capacity , data_length AS data_bytes, index_length AS index_bytes, table_collation AS collation, auto_increment, table_rows AS num_rows , engine FROM information_schema.tables WHERE table_type != ? AND table_schema = ? AND table_name IN (?) ORDER BY 1'),
      queryCount?: string(name='QueryCount', description='The number of queries performed in association with the SQL pattern within the query time range.', example='16'),
      reportDate?: string(name='ReportDate', description='The start date of the query.', example='2021-08-30'),
      user?: string(name='User', description='The username.

> This parameter is returned only when `Type` is left empty or set to `user`.', example='test_acc'),
    }
  ](name='Items', description='The queried SQL pattern.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='B6F2D1B4-2C9F-5622-B424-5E7965******'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model DescribeSqlPatternResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSqlPatternResponseBody(name='body'),
}

/**
 * @summary Queries a list of SQL patterns for an AnalyticDB for MySQL cluster within a time range.
 *
 * @param request DescribeSqlPatternRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSqlPatternResponse
 */
async function describeSqlPatternWithOptions(request: DescribeSqlPatternRequest, runtime: Util.RuntimeOptions): DescribeSqlPatternResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sqlPattern)) {
    query['SqlPattern'] = request.sqlPattern;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSqlPattern',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of SQL patterns for an AnalyticDB for MySQL cluster within a time range.
 *
 * @param request DescribeSqlPatternRequest
 * @return DescribeSqlPatternResponse
 */
async function describeSqlPattern(request: DescribeSqlPatternRequest): DescribeSqlPatternResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSqlPatternWithOptions(request, runtime);
}

model DescribeSyncAvailableDBClusterListRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  queryType?: string(name='QueryType', description='The query type.

Valid values:

*   Target
*   Source

This parameter is required.', example='Source'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-4690g37929****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sourceDBCluster?: [ 
    {
      clusterIds?: string(name='ClusterIds', description='The ID of the source instance or cluster. Separate multiple IDs with commas (,).', example='rm-bp1l3yh04y7us147n'),
      regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
      type?: string(name='Type', description='The database type of the source instance or cluster.

Valid values:

*   rds: ApsaraDB RDS.
*   sls: Simple Log Service.
*   polardb: PolarDB.', example='rds'),
    }
  ](name='SourceDBCluster', description='The source instances or clusters.'),
  syncPlatform?: string(name='SyncPlatform', description='The synchronization platform.', example='ADB-CDC'),
}

model DescribeSyncAvailableDBClusterListResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='FBD1DD96-AD1D-516C-9D9A-60BA081F66EE'),
  syncAvailableDBClusters?: [ 
    {
      DBClusterDescription?: string(name='DBClusterDescription', description='The description of the instance or cluster.', example='DB1'),
      DBClusterId?: string(name='DBClusterId', description='The instance or cluster ID.', example='rm-bp1l3yh04y7us147n'),
      DBType?: string(name='DBType', description='The database type of the instance or cluster.', example='rds'),
      storageSize?: float(name='StorageSize', description='The storage size.', example='1000'),
      tableNumber?: int32(name='TableNumber', description='The number of tables.', example='100'),
    }
  ](name='SyncAvailableDBClusters', description='The queried instances or clusters.'),
}

model DescribeSyncAvailableDBClusterListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSyncAvailableDBClusterListResponseBody(name='body'),
}

/**
 * @summary Queries a list of instances or clusters that are available for data synchronization.
 *
 * @param request DescribeSyncAvailableDBClusterListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSyncAvailableDBClusterListResponse
 */
async function describeSyncAvailableDBClusterListWithOptions(request: DescribeSyncAvailableDBClusterListRequest, runtime: Util.RuntimeOptions): DescribeSyncAvailableDBClusterListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.queryType)) {
    query['QueryType'] = request.queryType;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sourceDBCluster)) {
    query['SourceDBCluster'] = request.sourceDBCluster;
  }
  if (!Util.isUnset(request.syncPlatform)) {
    query['SyncPlatform'] = request.syncPlatform;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSyncAvailableDBClusterList',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of instances or clusters that are available for data synchronization.
 *
 * @param request DescribeSyncAvailableDBClusterListRequest
 * @return DescribeSyncAvailableDBClusterListResponse
 */
async function describeSyncAvailableDBClusterList(request: DescribeSyncAvailableDBClusterListRequest): DescribeSyncAvailableDBClusterListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSyncAvailableDBClusterListWithOptions(request, runtime);
}

model DescribeSyncJobListRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a region.

This parameter is required.', example='am-8vb39udfi356l9psq'),
  getSourceDetail?: boolean(name='GetSourceDetail', description='Specifies whether to obtain details about the source instance or cluster.', example='true'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='30'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sourceDBClusterDescription?: string(name='SourceDBClusterDescription', description='The description of the source cluster.', example='test'),
  sourceDBClusterId?: string(name='SourceDBClusterId', description='The ID of the source cluster. You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/170879.html) operation to query backup set IDs.

>  If you want to restore the data of an ApsaraDB for ClickHouse cluster, this parameter is required.', example='pc-t4n766v2llx852n81'),
  sourceDBType?: string(name='SourceDBType', description='The source database type.', example='sls'),
}

model DescribeSyncJobListResponseBody = {
  DBClusterId?: int32(name='DBClusterId', description='The cluster ID.', example='am-j6c22lubl8d9l3989'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='482B8BAE-6EC0-5C0E-B2AF-FD42A3FC5B67'),
  syncJobs?: [ 
    {
      jobId?: string(name='JobId', description='The ID of the Spark job.', example='dts-xxxxx'),
      regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
      sourceDBClusterDescription?: string(name='SourceDBClusterDescription', description='The description of the source instance or cluster.', example='test'),
      sourceDBClusterId?: string(name='SourceDBClusterId', description='The ID of the source cluster. You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/170879.html) operation to query backup set IDs.

>  If you want to restore the data of an ApsaraDB for ClickHouse cluster, this parameter is required.', example='pc-t4n766v2llx852n81'),
      sourceDBType?: string(name='SourceDBType', description='The database type of the source instance or cluster.', example='polardb'),
      sourceStorageSize?: int32(name='SourceStorageSize', description='The storage size of the source instance or cluster.', example='100'),
      sourceTableNumber?: int32(name='SourceTableNumber', description='The number of tables in the source instance or cluster.', example='100'),
      syncPlatform?: string(name='SyncPlatform', description='The synchronization platform.', example='ADB-CDC'),
    }
  ](name='SyncJobs', description='The queried synchronization jobs.'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='100'),
}

model DescribeSyncJobListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSyncJobListResponseBody(name='body'),
}

/**
 * @summary Queries a list of synchronization jobs in an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeSyncJobListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSyncJobListResponse
 */
async function describeSyncJobListWithOptions(request: DescribeSyncJobListRequest, runtime: Util.RuntimeOptions): DescribeSyncJobListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.getSourceDetail)) {
    query['GetSourceDetail'] = request.getSourceDetail;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sourceDBClusterDescription)) {
    query['SourceDBClusterDescription'] = request.sourceDBClusterDescription;
  }
  if (!Util.isUnset(request.sourceDBClusterId)) {
    query['SourceDBClusterId'] = request.sourceDBClusterId;
  }
  if (!Util.isUnset(request.sourceDBType)) {
    query['SourceDBType'] = request.sourceDBType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSyncJobList',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of synchronization jobs in an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeSyncJobListRequest
 * @return DescribeSyncJobListResponse
 */
async function describeSyncJobList(request: DescribeSyncJobListRequest): DescribeSyncJobListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSyncJobListWithOptions(request, runtime);
}

model DescribeTableAccessCountRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the details of all AnalyticDB for MySQL clusters within a specified region, including cluster IDs.

This parameter is required.', example='am-bp1r053byu48p****'),
  order?: string(name='Order', description='The order by which to sort query results. Specify the parameter value in the JSON string format. Example: `[{"Field":"TableSchema","Type":"Asc"}]`.

*   `Field` indicates the field that is used to sort the retrieved entries. Valid values:

    *   `TableSchema`: the name of the database to which the table belongs.
    *   `TableName`: the name of the table.
    *   `AccessCount`: the number of accesses to the table.

*   `Type` indicates the sorting method. Valid values:

    *   `Asc`: ascending order.
    *   `Desc`: descending order.

>  If this parameter is not specified, query results are sorted in ascending order of the database to which a specific table belongs.', example='[{"Field":"TableSchema","Type":"Asc"}]'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return. The value must be an integer that is greater than 0. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. The value must be a positive integer. Default value: **30**.', example='30'),
  regionId?: string(name='RegionId', description='The ID of the region.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the regions and zones supported by AnalyticDB for MySQL, including region IDs.

This parameter is required.', example='cn-hangzhou'),
  startTime?: string(name='StartTime', description='The date to query. Specify the time in the *yyyy-MM-dd* format. The time must be in UTC.

>  Only data for the last 30 days can be queried.

This parameter is required.', example='2021-08-30'),
  tableName?: string(name='TableName', description='The name of the specific table.

>  If this parameter is not specified, the number of accesses to all tables within the specified cluster for a specified date is returned.', example='CUSTOMER'),
}

model DescribeTableAccessCountResponseBody = {
  items?: [ 
    {
      accessCount?: string(name='AccessCount', description='The number of accesses to the table.', example='6'),
      instanceName?: string(name='InstanceName', description='The ID of the cluster to which the table belongs.', example='am-bp1r053byu48p****'),
      reportDate?: string(name='ReportDate', description='The date when the table was used.', example='2021-08-30'),
      tableName?: string(name='TableName', description='The name of the table.', example='CUSTOMER'),
      tableSchema?: string(name='TableSchema', description='The database to which the table belongs.', example='tpch'),
    }
  ](name='Items', description='Details about the table usage.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned on the current page.', example='30'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='C242707A-01D1-54DA-A5F6-671557******'),
  totalCount?: int32(name='TotalCount', description='The total number of entries.', example='1'),
}

model DescribeTableAccessCountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTableAccessCountResponseBody(name='body'),
}

/**
 * @summary 查询表访问统计信息
 *
 * @param request DescribeTableAccessCountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTableAccessCountResponse
 */
async function describeTableAccessCountWithOptions(request: DescribeTableAccessCountRequest, runtime: Util.RuntimeOptions): DescribeTableAccessCountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTableAccessCount',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询表访问统计信息
 *
 * @param request DescribeTableAccessCountRequest
 * @return DescribeTableAccessCountResponse
 */
async function describeTableAccessCount(request: DescribeTableAccessCountRequest): DescribeTableAccessCountResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTableAccessCountWithOptions(request, runtime);
}

model DescribeTableDetailRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the cluster.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  schemaName?: string(name='SchemaName', description='The name of the database.

This parameter is required.', example='adb_demo'),
  tableName?: string(name='TableName', description='The name of the table.

This parameter is required.', example='test'),
}

model DescribeTableDetailResponseBody = {
  avgSize?: long(name='AvgSize', description='The average number of rows in partitions.', example='0'),
  items?: {
    shard?: [ 
      {
        id?: int32(name='Id'),
        size?: long(name='Size'),
      }
    ](name='Shard'),
  }(name='Items', description='The list of partitions.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeTableDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTableDetailResponseBody(name='body'),
}

/**
 * @summary 查询表详情
 *
 * @param request DescribeTableDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTableDetailResponse
 */
async function describeTableDetailWithOptions(request: DescribeTableDetailRequest, runtime: Util.RuntimeOptions): DescribeTableDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.schemaName)) {
    query['SchemaName'] = request.schemaName;
  }
  if (!Util.isUnset(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTableDetail',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询表详情
 *
 * @param request DescribeTableDetailRequest
 * @return DescribeTableDetailResponse
 */
async function describeTableDetail(request: DescribeTableDetailRequest): DescribeTableDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTableDetailWithOptions(request, runtime);
}

model DescribeTablePartitionDiagnoseRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the cluster.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  lang?: string(name='Lang', description='The language of the content within the request and response. Default value: **zh**. Valid values:

*   **zh**: Chinese.
*   **en**: English.', example='zh'),
  order?: string(name='Order', description='The order by which to sort query results. Specify the parameter value in the JSON string format. Example: `[{"Field":"TotalSize","Type":"Desc"}]`.

*   `Field` specifies the field by which to sort the query results. Valid values:

    *   `SchemaName`: the name of the database to which the table belongs.
    *   `TableName`: the name of the table.
    *   `TotalSize`: the total data size of the table.
    *   `SpaceRatio`: the storage percentage of the table.

*   `Type` specifies the sorting order. Valid values:

    *   `Asc`: ascending order.
    *   `Desc`: descending order.

>  If you do not specify this parameter, the query results are sorted by the TotalSize field in descending order.', example='[{\\\\"Field\\\\":\\\\"TotalSize\\\\",\\\\"Type\\\\":\\\\"Desc\\\\"}]'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   30
*   50
*   100

Default value: 30.', example='30'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeTablePartitionDiagnoseResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The ID of the cluster.', example='am-bp1xxxxxxxx47'),
  detectionItems?: [ 
    {
      message?: string(name='Message', description='The detection result.', example='A total of 10 tables have an improper partition field'),
      name?: string(name='Name', description='The name of the detection item.', example='Improper Partition Field Diagnosis'),
      status?: string(name='Status', description='The severity level of the detection result. Valid values:

*   NORMAL
*   WARNING
*   CRITICAL', example='WARNING'),
    }
  ](name='DetectionItems', description='The queried detection items and detection results.'),
  items?: [ 
    {
      partitionDetail?: string(name='PartitionDetail', description='The information about inappropriate partitions.', example='202005,202006'),
      partitionNumber?: int32(name='PartitionNumber', description='The number of partitions.', example='2'),
      schemaName?: string(name='SchemaName', description='The name of the database.', example='test_db'),
      spaceRatio?: double(name='SpaceRatio', description='The storage percentage of the table. Unit: %.

>  Formula: Table storage percentage = Total data size of a table/Total data size of the cluster × 100%.', example='66.23'),
      tableName?: string(name='TableName', description='The name of the table.', example='test_table'),
      totalSize?: long(name='TotalSize', description='The total data size of the table. Unit: bytes.', example='42949672960'),
    }
  ](name='Items', description='The table statistics.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='30'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  suggestMaxRecordsPerPartition?: long(name='SuggestMaxRecordsPerPartition', description='The recommended maximum number of rows in each list partition.', example='640000000'),
  suggestMinRecordsPerPartition?: long(name='SuggestMinRecordsPerPartition', description='The recommended minimum number of rows in each list partition.', example='64000000'),
  totalCount?: int32(name='TotalCount', description='The total number of entries.', example='1'),
}

model DescribeTablePartitionDiagnoseResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTablePartitionDiagnoseResponseBody(name='body'),
}

/**
 * @summary Queries the information about partition diagnostics.
 *
 * @param request DescribeTablePartitionDiagnoseRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTablePartitionDiagnoseResponse
 */
async function describeTablePartitionDiagnoseWithOptions(request: DescribeTablePartitionDiagnoseRequest, runtime: Util.RuntimeOptions): DescribeTablePartitionDiagnoseResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTablePartitionDiagnose',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about partition diagnostics.
 *
 * @param request DescribeTablePartitionDiagnoseRequest
 * @return DescribeTablePartitionDiagnoseResponse
 */
async function describeTablePartitionDiagnose(request: DescribeTablePartitionDiagnoseRequest): DescribeTablePartitionDiagnoseResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTablePartitionDiagnoseWithOptions(request, runtime);
}

model DescribeTableStatisticsRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query a list of cluster IDs.

This parameter is required.', example='am-****************'),
  keyword?: string(name='Keyword', description='The keyword that is used to query information by table name.', example='you_table_name'),
  order?: string(name='Order', description='The order in which to sort the queried information. Specify this parameter as an ordered JSON array that consists of the `Field` and `Type` fields. Example: `[{ "Field":"TableName", "Type":"Asc" }]`.

*   `Field` specifies the field that is used to sort the queried information. The following fields are supported: `TableName`, ColdDataSize, DataSize, PrimaryKeyIndexSize, RowCount, IndexSize, SchemaName, and PartitionCount.

*   `Type` specifies the sorting order. Valid values (case-insensitive):

    *   **Desc**: descending order.
    *   **Asc**: ascending order.', example='[ { "Field":"TableName", "Type":"Asc" } ]'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', description='The page number. Pages start from page 1. Default value: **1**.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.', example='cn-beijing'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  schemaName?: string(name='SchemaName'),
}

model DescribeTableStatisticsResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-****************'),
  items?: {
    tableStatisticRecords?: [ 
    {
      coldDataSize?: long(name='ColdDataSize', description='The cold data size. Unit: bytes.

>  The parameter is returned only for AnalyticDB for MySQL clusters of V3.1.3.4 or later.', example='0'),
      dataSize?: long(name='DataSize', description='The data size of table records. Unit: bytes.

>  The data size of table records, excluding the data size of regular index and primary key indexes.', example='15592'),
      hotDataSize?: long(name='HotDataSize', description='The hot data size. Unit: bytes.', example='1048576'),
      indexSize?: long(name='IndexSize', description='The data size of regular indexes. Unit: bytes.', example='3076'),
      otherSize?: long(name='OtherSize', description='The data size of other data. Unit: bytes.', example='1048576'),
      partitionCount?: long(name='PartitionCount', description='The number of partitions.', example='1'),
      primaryKeyIndexSize?: long(name='PrimaryKeyIndexSize', description='The data size of primary key indexes. Unit: bytes.', example='16340'),
      rowCount?: long(name='RowCount', description='The number of rows in the table.', example='3'),
      schemaName?: string(name='SchemaName', description='The name of the database.', example='test_schema'),
      spaceRatio?: double(name='SpaceRatio', description='The percentage of the table size. Unit: %.

>  Formula: Table storage percentage = Total data size of a table/Total data size of the cluster × 100%.', example='66.23'),
      tableName?: string(name='TableName', description='The name of the table.', example='test_table'),
      totalSize?: long(name='TotalSize', description='The total data size. Unit: bytes.

>  The following formulas can be used to calculate the total data size: Formula 1: Total data size = Hot data size + Cold data size. Formula 2: Total data size = Data size of table records + Data size of regular indexes + Data size of primary key indexes + Data size of other data.', example='1577'),
    }
  ](name='TableStatisticRecords')
  }(name='Items', description='The queried table statistics.'),
  pageNumber?: string(name='PageNumber', description='The page number.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='4C4433FF-5D3A-4C3E-A19C-6D93B2******'),
  schemaNames?: string(name='SchemaNames'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model DescribeTableStatisticsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTableStatisticsResponseBody(name='body'),
}

/**
 * @summary Queries the information about table statistics for an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeTableStatisticsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTableStatisticsResponse
 */
async function describeTableStatisticsWithOptions(request: DescribeTableStatisticsRequest, runtime: Util.RuntimeOptions): DescribeTableStatisticsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.schemaName)) {
    query['SchemaName'] = request.schemaName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTableStatistics',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about table statistics for an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeTableStatisticsRequest
 * @return DescribeTableStatisticsResponse
 */
async function describeTableStatistics(request: DescribeTableStatisticsRequest): DescribeTableStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTableStatisticsWithOptions(request, runtime);
}

model DescribeTablesRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  schemaName?: string(name='SchemaName', description='The name of the database.

This parameter is required.', example='adb_demo'),
}

model DescribeTablesResponseBody = {
  items?: {
    table?: [ 
    {
      DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.', example='am-bp1xxxxxxxx47'),
      schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
      tableName?: string(name='TableName', description='The name of the table.', example='test'),
    }
  ](name='Table')
  }(name='Items', description='The queried tables.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DescribeTablesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTablesResponseBody(name='body'),
}

/**
 * @summary Queries a list of tables in a database of an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeTablesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTablesResponse
 */
async function describeTablesWithOptions(request: DescribeTablesRequest, runtime: Util.RuntimeOptions): DescribeTablesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.schemaName)) {
    query['SchemaName'] = request.schemaName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTables',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of tables in a database of an AnalyticDB for MySQL cluster.
 *
 * @param request DescribeTablesRequest
 * @return DescribeTablesResponse
 */
async function describeTables(request: DescribeTablesRequest): DescribeTablesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTablesWithOptions(request, runtime);
}

model DescribeTaskInfoRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.', example='cn-hongkong'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  taskId?: int32(name='TaskId', description='The task ID.

This parameter is required.', example='225685759'),
}

model DescribeTaskInfoResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  taskInfo?: {
    beginTime?: string(name='BeginTime', description='The start time of the task. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format.', example='2020-01-07T07:39:56Z'),
    finishTime?: string(name='FinishTime', description='The end time of the task. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format.', example='2020-01-07T08:08:50Z'),
    progress?: string(name='Progress', description='The progress of the task. Unit: %.', example='100'),
    status?: string(name='Status', description='The status. Valid values:

*   Waiting
*   Running
*   Finished
*   Failed
*   Closed
*   Cancel
*   Retry
*   Pause
*   Stop', example='Finished'),
    taskId?: int32(name='TaskId', description='The task ID.', example='225685759'),
  }(name='TaskInfo', description='The queried task.'),
}

model DescribeTaskInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTaskInfoResponseBody(name='body'),
}

/**
 * @summary Queries the information about a task.
 *
 * @param request DescribeTaskInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTaskInfoResponse
 */
async function describeTaskInfoWithOptions(request: DescribeTaskInfoRequest, runtime: Util.RuntimeOptions): DescribeTaskInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTaskInfo',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about a task.
 *
 * @param request DescribeTaskInfoRequest
 * @return DescribeTaskInfoResponse
 */
async function describeTaskInfo(request: DescribeTaskInfoRequest): DescribeTaskInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTaskInfoWithOptions(request, runtime);
}

model DescribeVSwitchesRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  vpcId?: string(name='VpcId', description='The virtual private cloud (VPC) ID.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the VPC ID.', example='vpc-bp13h7uzhulpuxvnp****'),
  vswId?: string(name='VswId', description='The vSwitch ID.', example='vsw-8vbpu1teend1qcosfojlz'),
  zoneId?: string(name='ZoneId', description='The zone ID.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/129857.html) operation to query the most recent zone list.', example='cn-hangzhou-h'),
}

model DescribeVSwitchesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='D65A809F-34CE-4550-9BC1-0ED21ETG380'),
  vSwitches?: {
    vSwitch?: [ 
      {
        aliUid?: string(name='AliUid', description='The ID of the Resource Access Management (RAM) user.', example='195813423043****'),
        bid?: string(name='Bid', description='The ID of the user channel.', example='2****'),
        cidrBlock?: string(name='CidrBlock', description='The IPv4 CIDR block of the vSwitch.', example='172.16.0.0/24'),
        gmtCreate?: string(name='GmtCreate', description='The time when the vSwitch was created.', example='2022-01-18T12:43:57Z'),
        gmtModified?: string(name='GmtModified', description='The time when the vSwitch was modified.', example='2022-01-22T12:43:57Z'),
        isDefault?: boolean(name='IsDefault', description='Indicates whether the vSwitch is the default vSwitch. Valid values: **true**: The vSwitch is the default vSwitch. **false**: The vSwitch is not the default vSwitch.', example='false'),
        izNo?: string(name='IzNo', description='The zone ID of the vSwitch.', example='cn-hangzhou-k'),
        regionNo?: string(name='RegionNo', description='The region ID of the vSwitch.', example='cn-hangzhou'),
        status?: string(name='Status', description='The state of the vSwitch. Valid values: **Pending**: the vSwitch is being configured. **Available**: the vSwitch is available.', example='Available'),
        vSwitchId?: string(name='VSwitchId', description='The vSwitch ID.', example='vsw-25bcdxs7pv1****'),
        vSwitchName?: string(name='VSwitchName', description='The name of the vSwitch.', example='vswitch'),
      }
    ](name='VSwitch', description='The queried vSwitch.'),
  }(name='VSwitches', description='The queried vSwitches.'),
}

model DescribeVSwitchesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVSwitchesResponseBody(name='body'),
}

/**
 * @summary Queries the vSwitches.
 *
 * @param request DescribeVSwitchesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVSwitchesResponse
 */
async function describeVSwitchesWithOptions(request: DescribeVSwitchesRequest, runtime: Util.RuntimeOptions): DescribeVSwitchesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!Util.isUnset(request.vswId)) {
    query['VswId'] = request.vswId;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeVSwitches',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the vSwitches.
 *
 * @param request DescribeVSwitchesRequest
 * @return DescribeVSwitchesResponse
 */
async function describeVSwitches(request: DescribeVSwitchesRequest): DescribeVSwitchesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeVSwitchesWithOptions(request, runtime);
}

model DescribeVSwitchsRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  vpcId?: string(name='VpcId', description='The virtual private cloud (VPC) ID.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the VPC ID.', example='vpc-2ze1lz7nk4pn4zwy1j7pm'),
  zoneId?: string(name='ZoneId', description='The zone ID.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/129857.html) operation to query the most recent zone list.', example='cn-hangzhou-h'),
}

model DescribeVSwitchsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1B892DA2-9ABC-5CC0-AD73-405479C3FA53'),
  vSwitches?: {
    vSwitch?: [ 
      {
        aliUid?: string(name='AliUid', description='The ID of the Resource Access Management (RAM) user.', example='195813423043****'),
        bid?: string(name='Bid', description='The ID of the user channel.', example='26842'),
        cidrBlock?: string(name='CidrBlock', description='The IPv4 CIDR block of the vSwitch.', example='172.16.0.0/24'),
        gmtCreate?: string(name='GmtCreate', description='The time when the vSwitch was created.', example='2022-01-18T12:43:57Z'),
        gmtModified?: string(name='GmtModified', description='The time when the vSwitch was modified.', example='2022-01-22T12:43:57Z'),
        isDefault?: boolean(name='IsDefault', description='Indicates whether the vSwitch is the default vSwitch. Valid values: **true**: The vSwitch is the default vSwitch. **false**: The vSwitch is not the default vSwitch.', example='true'),
        izNo?: string(name='IzNo', description='The zone ID of the vSwitch.', example='cn-hangzhou-k'),
        regionNo?: string(name='RegionNo', description='The region ID of the vSwitch.', example='cn-hangzhou'),
        status?: string(name='Status', description='The state of the vSwitch. Valid values: **Pending**: the vSwitch is being configured. **Available**: the vSwitch is available.', example='Available'),
        vSwitchId?: string(name='VSwitchId', description='The vSwitch ID.', example='vsw-25bcdxs7pv1****'),
        vSwitchName?: string(name='VSwitchName', description='The name of the vSwitch.', example='VSW-Test-hangzhou-I'),
      }
    ](name='VSwitch', description='The queried vSwitch.'),
  }(name='VSwitches', description='The queried vSwitches.'),
}

model DescribeVSwitchsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVSwitchsResponseBody(name='body'),
}

/**
 * @summary Queries a list of available vSwitches.
 *
 * @param request DescribeVSwitchsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVSwitchsResponse
 */
async function describeVSwitchsWithOptions(request: DescribeVSwitchsRequest, runtime: Util.RuntimeOptions): DescribeVSwitchsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeVSwitchs',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of available vSwitches.
 *
 * @param request DescribeVSwitchsRequest
 * @return DescribeVSwitchsResponse
 */
async function describeVSwitchs(request: DescribeVSwitchsRequest): DescribeVSwitchsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeVSwitchsWithOptions(request, runtime);
}

model DescribeVpcsRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  vpcId?: string(name='VpcId', description='The VPC ID.', example='vpc-bp13h7uzhulpuxvnp****'),
  zoneId?: string(name='ZoneId', description='The zone ID.', example='cn-hangzhou-k'),
}

model DescribeVpcsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='78BDC895-F7C0-5961-92BE-F1C3D12B4BB5'),
  vpcs?: {
    vpc?: [ 
      {
        aliUid?: string(name='AliUid', description='The ID of the Alibaba Cloud account.', example='1431771514176727'),
        bid?: string(name='Bid', description='The user channel ID.', example='26842'),
        cidrBlock?: string(name='CidrBlock', description='The IPv4 CIDR block of the VPC.', example='192.168.0.0/16'),
        gmtCreate?: string(name='GmtCreate', description='The time when the VPC was created.', example='1693217052000'),
        gmtModified?: string(name='GmtModified', description='The time when the VPC was modified.', example='1724639118000'),
        isDefault?: boolean(name='IsDefault', description='Indicates whether the VPC is the default VPC in the region. Valid values:

*   true
*   false', example='false'),
        regionNo?: string(name='RegionNo', description='The region in which the VPC resides.', example='cn-hangzhou'),
        status?: string(name='Status', description='The status of the VPC. Valid values:

*   Pending
*   Available', example='Available'),
        vSwitchs?: [ 
          {
            cidrBlock?: string(name='CidrBlock', description='The IPv4 CIDR block of the vSwitch.', example='172.17.0.0/24'),
            gmtCreate?: string(name='GmtCreate', description='The time when the vSwitch was created.', example='1549012834000'),
            gmtModified?: string(name='GmtModified', description='The time when the vSwitch was modified.', example='1731031910000'),
            isDefault?: boolean(name='IsDefault', description='Indicates whether the vSwitch is the default vSwitch. Valid values: **true** **false**', example='false'),
            izNo?: string(name='IzNo', description='The zone ID of the vSwitch.', example='cn-hangzhou-j'),
            status?: string(name='Status', description='The status of the vSwitch. Valid values:

*   Pending
*   Available', example='Available'),
            vSwitchId?: string(name='VSwitchId', description='The vSwitch ID.', example='vsw-8vbxk6ij0yz16bu4l3ijj'),
            vSwitchName?: string(name='VSwitchName', description='The name of the vSwitch.', example='vs1'),
          }
        ](name='VSwitchs', description='The vSwitches in the VPC.'),
        vpcId?: string(name='VpcId', description='The ID of the VPC.', example='vpc-uf6m0r5pihw1r79od6990'),
        vpcName?: string(name='VpcName', description='The name of the VPC.', example='vpc1'),
      }
    ](name='Vpc', description='The queried VPC.'),
  }(name='Vpcs', description='The queried VPCs.'),
}

model DescribeVpcsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVpcsResponseBody(name='body'),
}

/**
 * @summary Queries a list of available virtual private clouds (VPCs).
 *
 * @param request DescribeVpcsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVpcsResponse
 */
async function describeVpcsWithOptions(request: DescribeVpcsRequest, runtime: Util.RuntimeOptions): DescribeVpcsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeVpcs',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of available virtual private clouds (VPCs).
 *
 * @param request DescribeVpcsRequest
 * @return DescribeVpcsResponse
 */
async function describeVpcs(request: DescribeVpcsRequest): DescribeVpcsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeVpcsWithOptions(request, runtime);
}

model DescribeWorkerDetectionRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-xxxxx'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC. The end time must be later than the start time.', example='2024-04-25T02:04Z'),
  lang?: string(name='Lang', description='The language of the content within the request and response. Default value: **zh**. Valid values:

*   **zh**: Chinese.
*   **en**: English.', example='zh'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify the time in the ISO 8601 standard in the *yyyy-MM-ddTHH:mmZ* format. The time must be in UTC.

>  You can query data only within the last 15 days.', example='2011-06-01T16:00Z'),
}

model DescribeWorkerDetectionResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='amv-xxx'),
  detectionItems?: [ 
    {
      message?: string(name='Message', description='The information about the detection result.', example='Multiple abnormal operators are detected.'),
      name?: string(name='Name', description='The name of the detection item.', example='Metric detection'),
      results?: {
        operatorAgg?: [ 
          {
            metricName?: string(name='MetricName', description='The name of the detection metric.', example='OperatorCost'),
            searchResults?: [ 
              {
                avgValue?: double(name='AvgValue', description='The average value of the operator metric.', example='234'),
                maxValue?: long(name='MaxValue', description='The maximum value of the operator metric.', example='3'),
                operatorCount?: long(name='OperatorCount', description='The number of occurrences of the operator.', example='345'),
                operatorName?: string(name='OperatorName', description='The name of the operator.', example='StageOutput'),
                totalValue?: long(name='TotalValue', description='The cumulative value of the operator metric.', example='3333'),
              }
            ](name='SearchResults', description='The detection result items of operator metric aggregation.'),
          }
        ](name='OperatorAgg', description='The detection result items of operator metric aggregation.'),
        operatorDetails?: [ 
          {
            metricName?: string(name='MetricName', description='The name of the detection metric.', example='Peak memory'),
            searchResults?: [ 
              {
                inputRows?: long(name='InputRows', description='The number of rows input by the operator.', example='235'),
                inputSize?: long(name='InputSize', description='The amount of data input by the operator. Unit: bytes.', example='2345'),
                operatorCost?: long(name='OperatorCost', description='The total CPU time consumed by all operators in the stage, which is equivalent to the total CPU time of the stage. You can use this parameter to determine which parts of the stage consume a large amount of computing resources. Unit: milliseconds.', example='235'),
                operatorInfo?: string(name='OperatorInfo', description='The property information about the operator.', example='Aggregate function: count'),
                operatorName?: string(name='OperatorName', description='The name of the operator.', example='TableScan'),
                outputRows?: long(name='OutputRows', description='The number of rows output by the operator.', example='345'),
                outputSize?: long(name='OutputSize', description='The amount of data output by the operator. Unit: bytes.', example='323'),
                peakMemory?: long(name='PeakMemory', description='The peak memory. Unit: bytes.', example='234'),
                processId?: string(name='ProcessId', description='The query ID that can be used for diagnostics.', example='2024072416154919216812815303453136244'),
                stageId?: string(name='StageId', description='The stage ID.', example='Stage[7]'),
              }
            ](name='SearchResults', description='The detection result items of abnormal operators.'),
          }
        ](name='OperatorDetails', description='The detection result items of abnormal operators.'),
        partitionedTables?: [ 
          {
            DDL?: string(name='DDL', description='The SQL statement that is used to create the table.', example='create table user(id varchar)'),
            partitionCount?: string(name='PartitionCount', description='The number of partitions.', example='4'),
            partitionIds?: string(name='PartitionIds', description='The ID of the improper partition.', example='[2025,2026]'),
            schemaName?: string(name='SchemaName', description='The name of the database.', example='kp_ods'),
            tableName?: string(name='TableName', description='The name of the table.', example='lake_count'),
            totalDataSize?: long(name='TotalDataSize', description='1234', example='[2024,2025]'),
          }
        ](name='PartitionedTables', description='The detection result items of improper partitioned tables.'),
        skewedTables?: [ 
          {
            DDL?: string(name='DDL', description='The SQL statement that is used to create the table.', example='create table(id varchar)'),
            partitionCount?: int32(name='PartitionCount', description='The number of partitions.', example='3'),
            schemaName?: string(name='SchemaName', description='The name of the database.', example='kp_ods'),
            shardSkewedRows?: string(name='ShardSkewedRows', description='The number of skewed rows in the table.', example='345'),
            tableName?: string(name='TableName', description='The name of the table.', example='train_data_test'),
            totalDataSize?: long(name='TotalDataSize', description='The total data size of the table. Unit: bytes.', example='2345'),
            totalLocalDataSize?: string(name='TotalLocalDataSize', description='The size of hot data. Unit: bytes.', example='211'),
            totalPkSize?: long(name='TotalPkSize', description='The data size of the primary key. Unit: bytes.', example='1234'),
            totalRemoteDataSize?: long(name='TotalRemoteDataSize', description='The size of cold data. Unit: bytes.', example='23456'),
            totalRowCount?: long(name='TotalRowCount', description='The total number of rows in the table.', example='2335'),
          }
        ](name='SkewedTables', description='The detection result items of skewed tables.'),
        topAccessTables?: [ 
          {
            metricName?: string(name='MetricName', description='The name of the detection metric.', example='Table accesses'),
            searchResults?: [ 
              {
                accessCount?: long(name='AccessCount', description='The number of accesses to the table.', example='345'),
                avgScanCost?: double(name='AvgScanCost', description='The average amount of time for scanning. Unit: milliseconds.', example='234'),
                avgScanSize?: double(name='AvgScanSize', description='The average data size for scanning. Unit: bytes.', example='234'),
                maxScanCost?: long(name='MaxScanCost', description='The maximum amount of time for scanning. Unit: milliseconds.', example='2345'),
                maxScanSize?: long(name='MaxScanSize', description='The maximum data size for scanning. Unit: bytes.', example='234'),
                tableName?: string(name='TableName', description='The name of the table.', example='adb_lake_logs_pgsql'),
              }
            ](name='SearchResults', description='The detection result items of table access.'),
          }
        ](name='TopAccessTables', description='The detection result items of table access.'),
      }(name='Results', description='The detection result items.'),
      status?: string(name='Status', description='The severity level of the detection result. Valid values:

*   NORMAL
*   WARNING
*   CRITICAL', example='WARNING'),
    }
  ](name='DetectionItems', description='The queried detection items and detection results.'),
  requestId?: string(name='RequestId', description='The request ID.', example='37A6F56E-B970-50AF-AF33-C71E57AB2C8E'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='144'),
}

model DescribeWorkerDetectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeWorkerDetectionResponseBody(name='body'),
}

/**
 * @summary Queries the diagnostic results of the storage layer.
 *
 * @param request DescribeWorkerDetectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeWorkerDetectionResponse
 */
async function describeWorkerDetectionWithOptions(request: DescribeWorkerDetectionRequest, runtime: Util.RuntimeOptions): DescribeWorkerDetectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeWorkerDetection',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the diagnostic results of the storage layer.
 *
 * @param request DescribeWorkerDetectionRequest
 * @return DescribeWorkerDetectionResponse
 */
async function describeWorkerDetection(request: DescribeWorkerDetectionRequest): DescribeWorkerDetectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeWorkerDetectionWithOptions(request, runtime);
}

model DetachUserENIRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query cluster IDs.

This parameter is required.', example='am-bp11q28kvl688****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DetachUserENIResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model DetachUserENIResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DetachUserENIResponseBody(name='body'),
}

/**
 * @summary 关闭用户ENI
 *
 * @description You can call this operation only for AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters in elastic mode for Cluster Edition.
 *
 * @param request DetachUserENIRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DetachUserENIResponse
 */
async function detachUserENIWithOptions(request: DetachUserENIRequest, runtime: Util.RuntimeOptions): DetachUserENIResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DetachUserENI',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 关闭用户ENI
 *
 * @description You can call this operation only for AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters in elastic mode for Cluster Edition.
 *
 * @param request DetachUserENIRequest
 * @return DetachUserENIResponse
 */
async function detachUserENI(request: DetachUserENIRequest): DetachUserENIResponse {
  var runtime = new Util.RuntimeOptions{};
  return detachUserENIWithOptions(request, runtime);
}

model DisableAdviceServiceRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a region.

This parameter is required.', example='am-uf67culrr26q2****'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-shanghai'),
}

model DisableAdviceServiceResponseBody = {
  message?: string(name='Message', description='The returned message. Valid values:

*   If the request was successful, a **success** message is returned.
*   If the request failed, an error message is returned.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='57EC6CCA-A582-572C-A33D-F61845CBC03C'),
}

model DisableAdviceServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableAdviceServiceResponseBody(name='body'),
}

/**
 * @summary Disables the suggestion feature.
 *
 * @param request DisableAdviceServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableAdviceServiceResponse
 */
async function disableAdviceServiceWithOptions(request: DisableAdviceServiceRequest, runtime: Util.RuntimeOptions): DisableAdviceServiceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableAdviceService',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disables the suggestion feature.
 *
 * @param request DisableAdviceServiceRequest
 * @return DisableAdviceServiceResponse
 */
async function disableAdviceService(request: DisableAdviceServiceRequest): DisableAdviceServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableAdviceServiceWithOptions(request, runtime);
}

model DownloadDiagnosisRecordsRequest {
  clientIp?: string(name='ClientIp', description='The source IP addresses.

> You can call the [DescribeDiagnosisDimensions](https://help.aliyun.com/document_detail/308210.html) operation to query the resource group, database name, username, and source IP address of the SQL statements to be queried.', example='106.11.XX.XX'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-bp1r053byu48p****'),
  database?: string(name='Database', description='The name of the database on which the SQL statements are executed.

> You can call the [DescribeDiagnosisDimensions](https://help.aliyun.com/document_detail/308210.html) operation to query the resource group, database name, username, and source IP address of the SQL statements to be queried.', example='adb_demo'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Specify a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

> 

*   The end time must be later than the start time.

*   The maximum time range that can be specified is 24 hours.

This parameter is required.', example='1625220213000'),
  keyword?: string(name='Keyword', description='The keyword that is used for the query.', example='select'),
  lang?: string(name='Lang', description='The language of file titles and error messages. Valid values:

*   **zh** (default): simplified Chinese.
*   **en**: English.
*   **ja**: Japanese.
*   **zh-tw**: traditional Chinese.', example='zh'),
  maxPeakMemory?: long(name='MaxPeakMemory', description='The maximum peak memory of the SQL statements. Unit: bytes.', example='88000000'),
  maxScanSize?: long(name='MaxScanSize', description='The maximum scan size of the SQL statements. Unit: bytes.', example='110000000'),
  minPeakMemory?: long(name='MinPeakMemory', description='The minimum peak memory of the SQL statements. Unit: bytes.', example='88000000'),
  minScanSize?: long(name='MinScanSize', description='The minimum scan size of the SQL statements. Unit: bytes.', example='100000000'),
  queryCondition?: string(name='QueryCondition', description='The query condition for SQL statements, which can be a combination of the `Type` and `Value` fields or a combination of the Type, `Min`, and `Max` fields. Specify the conditions in the JSON format. `Type` specifies the query dimension. Valid values for Type: `maxCost`, `status`, and `cost`. `Value`, `Min`, or `Max` specifies the query range for the dimension. Valid values:

*   `{"Type":"maxCost","Value":"100"}`: queries the top 100 most time-consuming SQL statements. Set `Value` to 100.
*   `{"Type":"status","Value":"finished"}`: queries the executed SQL statements, **including successful and failed SQL statements**. You can set `Value` to `running` to query the SQL statements that are being executed. You can also set Value to `failed` to query the SQL statements that failed to be executed.
*   `{"Type":"cost","Min":"10","Max":"200"}`: queries the SQL statements whose execution duration is in the range of 10 to 200 milliseconds. You can also specify custom values for the Min and Max fields.

This parameter is required.', example='{"Type":"status","Value":"finished"}'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceGroup?: string(name='ResourceGroup', description='The resource group to which the SQL statements belong.

> You can call the [DescribeDiagnosisDimensions](https://help.aliyun.com/document_detail/308210.html) operation to query the resource group, database name, username, and source IP address of the SQL statements to be queried.', example='user_default'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Specify a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

> Only data within the last 14 days can be queried.

This parameter is required.', example='1625220210000'),
  userName?: string(name='UserName', description='The username that is used to execute the SQL statements.

> You can call the [DescribeDiagnosisDimensions](https://help.aliyun.com/document_detail/308210.html) operation to query the resource group, database name, username, and source IP address of the SQL statements to be queried.', example='test_user'),
}

model DownloadDiagnosisRecordsResponseBody = {
  downloadId?: int32(name='DownloadId', description='The ID of the download task.', example='68'),
  requestId?: string(name='RequestId', description='The request ID.', example='D4ACF4E0-2952-3A87-9A2C-474058******'),
}

model DownloadDiagnosisRecordsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DownloadDiagnosisRecordsResponseBody(name='body'),
}

/**
 * @summary Downloads the diagnostic information about SQL statements that meet a condition for an AnalyticDB for MySQL cluster.
 *
 * @param request DownloadDiagnosisRecordsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DownloadDiagnosisRecordsResponse
 */
async function downloadDiagnosisRecordsWithOptions(request: DownloadDiagnosisRecordsRequest, runtime: Util.RuntimeOptions): DownloadDiagnosisRecordsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientIp)) {
    query['ClientIp'] = request.clientIp;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.database)) {
    query['Database'] = request.database;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.maxPeakMemory)) {
    query['MaxPeakMemory'] = request.maxPeakMemory;
  }
  if (!Util.isUnset(request.maxScanSize)) {
    query['MaxScanSize'] = request.maxScanSize;
  }
  if (!Util.isUnset(request.minPeakMemory)) {
    query['MinPeakMemory'] = request.minPeakMemory;
  }
  if (!Util.isUnset(request.minScanSize)) {
    query['MinScanSize'] = request.minScanSize;
  }
  if (!Util.isUnset(request.queryCondition)) {
    query['QueryCondition'] = request.queryCondition;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroup)) {
    query['ResourceGroup'] = request.resourceGroup;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DownloadDiagnosisRecords',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Downloads the diagnostic information about SQL statements that meet a condition for an AnalyticDB for MySQL cluster.
 *
 * @param request DownloadDiagnosisRecordsRequest
 * @return DownloadDiagnosisRecordsResponse
 */
async function downloadDiagnosisRecords(request: DownloadDiagnosisRecordsRequest): DownloadDiagnosisRecordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return downloadDiagnosisRecordsWithOptions(request, runtime);
}

model EnableAdviceServiceRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a region.

This parameter is required.', example='am-bp1q10xxzq2z4****'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-shanghai'),
}

model EnableAdviceServiceResponseBody = {
  message?: string(name='Message', description='The message returned for the operation. Valid values:

*   **Success** is returned if the operation is successful.
*   An error message is returned if the operation fails.', example='Success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='E1745C03-7CCE-55CF-932E-08121AAFA6AF'),
}

model EnableAdviceServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableAdviceServiceResponseBody(name='body'),
}

/**
 * @summary 开通建议服务
 *
 * @param request EnableAdviceServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableAdviceServiceResponse
 */
async function enableAdviceServiceWithOptions(request: EnableAdviceServiceRequest, runtime: Util.RuntimeOptions): EnableAdviceServiceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableAdviceService',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 开通建议服务
 *
 * @param request EnableAdviceServiceRequest
 * @return EnableAdviceServiceResponse
 */
async function enableAdviceService(request: EnableAdviceServiceRequest): EnableAdviceServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableAdviceServiceWithOptions(request, runtime);
}

model GetCreateTableSQLRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a region.

This parameter is required.', example='am-uf6wjk5xxxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  schemaName?: string(name='SchemaName', description='The name of the database.', example='adb_demo'),
  tableName?: string(name='TableName', description='The name of the table.', example='test'),
}

model GetCreateTableSQLResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The detailed reason why the access was denied.', example='{
    "PolicyType": "AccountLevelIdentityBasedPolicy",
    "AuthPrincipalOwnerId": "1906102576997697",
    "EncodedDiagnosticMessage": "AQIBIAAAAOPdwKY2QLOvgMEc7SkkoJfj1kvZwsaRqNYMh10Tv0wTe0fCzaCdrvgazfNb0EnJKETgXyhR+3BIQjx9WAqZryejBsp1Bl4qI5En/D9dEhcXAtKCxCmE2kZCiEzpy8BoEUt+bs0DmlaGWO5xkEpttypLIB4rUhDvZd+zwPg4EXk4KSSWSWsurxtqDkKEMshKlQFBTKvJcNqPqHV6lwR4INiAGjIvK1ngXxN1O+6ORRB6A8YvztEOGywOk81ZmuNk0YrNy+qk7+UVDTHeXKsy8h9e/ePY/LMidj0RCmDpo/YpCumd0UGe0qEPe2U+UJAm/+UHlnEFLVg6BP3yIB5D++MCy7mgWm8Kwyhk62IeYly4hQ+5IpXjkh1GQXuDgLVVPVpxEek9n30vnCUL4KsaMgfa7dgojb+3TM8xGsD2zVK5STJNrsXclscIJEqyNXd7CBYiRJVZi1HPO6drN9WW0chLpCSTgjO8n0bNanZaxXKumW9PSwV58UoSFASeMWfZK3TLngX+oq8nGmnTwcJosVjfF4RGzAnS1IXt0Q9N2WHDnpwyLBU/nOz7Hsy8IZ+h+OVjsBTXSM9688/vOF707a5mNzpETvQeGRcua3A5livcKAM2cML0yeUs/Zyj/+BGqtVa+wektspDHC/CECh6R5lxQjRmUdPawY8VDs2onmdLuEH8DdmYt+Yv/jBFBUMWOyAluzkPYcX5nuQKouCIUJUFTSbsJsuH5CTIh7Ls5rbmkj+T1qTVz8gnDR8LxwaqoMSna+elXgVyOOxXtMkenVntsmoC3p/4G7yTPL1hu8JyWGIIvZHZGGLXGEH7FeSuMV8buKxPGFWG3arG8e9LGvDdz5dgTien4y6G5AQ0o1iQdXDos5VWdH3u7k5PrsvdEOpvMi6uSd8a42na80FsYlgGlwM5upydcWUC5Un2HCkJpT1xgk2L6shdVTrK6bidRrqE784FhW9bBQePzGaxSupPENZya0VUctRt+7uq3QwIn4y5jzjgX0E0jgmqPrgiVDjBesMQZYfGPCGysWYWYzfoh+G6V7N2VVGtNnGUwNWzM0WJBPONAgxPv+AmixFRCQ==",
    "AuthPrincipalType": "SubUser",
    "AuthPrincipalDisplayName": "202515810214480629",
    "NoPermissionType": "ImplicitDeny",
    "AuthAction": "adb:DescribeExcessivePrimaryKeys"
  }'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  SQL?: string(name='SQL', description='The SQL statement.', example='create table (
 id varchar(32)
);'),
}

model GetCreateTableSQLResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCreateTableSQLResponseBody(name='body'),
}

/**
 * @summary Queries the table creation statement for tables.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request GetCreateTableSQLRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCreateTableSQLResponse
 */
async function getCreateTableSQLWithOptions(request: GetCreateTableSQLRequest, runtime: Util.RuntimeOptions): GetCreateTableSQLResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.schemaName)) {
    query['SchemaName'] = request.schemaName;
  }
  if (!Util.isUnset(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCreateTableSQL',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the table creation statement for tables.
 *
 * @description For information about the endpoints of AnalyticDB for MySQL, see [Endpoints](https://help.aliyun.com/document_detail/612373.html).
 *
 * @param request GetCreateTableSQLRequest
 * @return GetCreateTableSQLResponse
 */
async function getCreateTableSQL(request: GetCreateTableSQLRequest): GetCreateTableSQLResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCreateTableSQLWithOptions(request, runtime);
}

model GrantOperatorPermissionRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query cluster IDs.

This parameter is required.', example='am-bp1565u55p32****'),
  expiredTime?: string(name='ExpiredTime', description='The expiration time of the service account permissions. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

This parameter is required.', example='2022-11-30T00:00:00Z'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  privileges?: string(name='Privileges', description='The name of the permissions. Valid values:

*   **Control**: configuration permissions. The service account is granted permissions to query and modify cluster configurations.
*   **Data**: data permissions. The service account is granted permissions to query schemas, indexes, and SQL statements.

This parameter is required.', example='Control'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model GrantOperatorPermissionResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='A438072A-E2E7-5509-9A3F-66293512A820'),
}

model GrantOperatorPermissionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GrantOperatorPermissionResponseBody(name='body'),
}

/**
 * @summary Grants permissions to the service account of an AnalyticDB for MySQL cluster.
 *
 * @description ###
 * If you need Alibaba Cloud technical support to perform operations on your AnalyticDB for MySQL cluster, you must grant permissions to the service account of your cluster. When the validity period of the authorization ends, the granted permissions are automatically revoked.
 *
 * @param request GrantOperatorPermissionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GrantOperatorPermissionResponse
 */
async function grantOperatorPermissionWithOptions(request: GrantOperatorPermissionRequest, runtime: Util.RuntimeOptions): GrantOperatorPermissionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.expiredTime)) {
    query['ExpiredTime'] = request.expiredTime;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.privileges)) {
    query['Privileges'] = request.privileges;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GrantOperatorPermission',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Grants permissions to the service account of an AnalyticDB for MySQL cluster.
 *
 * @description ###
 * If you need Alibaba Cloud technical support to perform operations on your AnalyticDB for MySQL cluster, you must grant permissions to the service account of your cluster. When the validity period of the authorization ends, the granted permissions are automatically revoked.
 *
 * @param request GrantOperatorPermissionRequest
 * @return GrantOperatorPermissionResponse
 */
async function grantOperatorPermission(request: GrantOperatorPermissionRequest): GrantOperatorPermissionResponse {
  var runtime = new Util.RuntimeOptions{};
  return grantOperatorPermissionWithOptions(request, runtime);
}

model KillProcessRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  processId?: string(name='ProcessId', description='The unique ID of the query. You can call the [DescribeProcessList](https://help.aliyun.com/document_detail/190092.html) operation to obtain the unique ID of a query.', example='202011191048151921681492420315100****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model KillProcessResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model KillProcessResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: KillProcessResponseBody(name='body'),
}

/**
 * @summary Terminates an ongoing query.
 *
 * @param request KillProcessRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return KillProcessResponse
 */
async function killProcessWithOptions(request: KillProcessRequest, runtime: Util.RuntimeOptions): KillProcessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.processId)) {
    query['ProcessId'] = request.processId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'KillProcess',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Terminates an ongoing query.
 *
 * @param request KillProcessRequest
 * @return KillProcessResponse
 */
async function killProcess(request: KillProcessRequest): KillProcessResponse {
  var runtime = new Util.RuntimeOptions{};
  return killProcessWithOptions(request, runtime);
}

model ListTagResourcesRequest {
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken.', example='212db86sca4384811e0b5e8707ec21345'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='The cluster ID. You can specify multiple cluster IDs. Valid values of N: 1 to 50.

> You must specify at least one of the following parameters: ResourceId.N and Tag.N.Key.', example='am-bp1l20nxxxxxxxxxx'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType', description='The type of the resource. Set the value to **cluster**.

This parameter is required.', example='cluster'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag. You can specify multiple tag keys. The tag key cannot be an empty string. Valid values of N: 1 to 20.

> You must specify at least one of the following parameters: ResourceId.N and Tag.N.Key.', example='testkey1'),
      value?: string(name='Value', description='The value of the tag. You can specify multiple tag values. The tag value can be an empty string. Valid values of N: 1 to 20.', example='testvalue1'),
    }
  ](name='Tag', description='The tags that are added to clusters.'),
}

model ListTagResourcesResponseBody = {
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. You must specify the token that is obtained from the previous query as the value of NextToken.', example='212db86sca4384811e0b5e8707ec21345'),
  requestId?: string(name='RequestId', description='The request ID.', example='184DE106-CB2C-4DD2-B57F-396652E6C8F8'),
  tagResources?: {
    tagResource?: [ 
    {
      resourceId?: string(name='ResourceId', description='The cluster ID.', example='am-bp1l20nxxxxxxxxxx'),
      resourceType?: string(name='ResourceType', description='The type of the resource. A value of cluster indicates an AnalyticDB for MySQL cluster.', example='cluster'),
      tagKey?: string(name='TagKey', description='The key of the tag.', example='testkey1'),
      tagValue?: string(name='TagValue', description='The value of the tag.', example='testvalue1'),
    }
  ](name='TagResource')
  }(name='TagResources', description='The tags that are added to clusters.'),
}

model ListTagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagResourcesResponseBody(name='body'),
}

/**
 * @summary Queries the tags that are added to AnalyticDB for MySQL clusters, or the AnalyticDB for MySQL clusters that have tags added.
 *
 * @param request ListTagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagResourcesResponse
 */
async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: Util.RuntimeOptions): ListTagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTagResources',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the tags that are added to AnalyticDB for MySQL clusters, or the AnalyticDB for MySQL clusters that have tags added.
 *
 * @param request ListTagResourcesRequest
 * @return ListTagResourcesResponse
 */
async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model MigrateDBClusterRequest {
  computeResource?: string(name='ComputeResource', description='The amount of reserved computing resources.
Valid values: 0ACU to 4096ACU. Step size: 16. Each AnalyticDB compute unit (ACU) is approximately equal to 1 core and 4 GB memory.', example='32ACU'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  productForm?: string(name='ProductForm', example='LegacyForm'),
  productVersion?: string(name='ProductVersion'),
  reservedNodeCount?: int32(name='ReservedNodeCount'),
  reservedNodeSize?: string(name='ReservedNodeSize'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  secondaryVSwitchId?: string(name='SecondaryVSwitchId'),
  secondaryZoneId?: string(name='SecondaryZoneId'),
  shardNumber?: string(name='ShardNumber', description='The number of shards that you want to change during the data migration.', example='128'),
  storageResource?: string(name='StorageResource', description='The amount of reserved storage resources. Valid values: 0ACU to 2064ACU. The value must be in increments of the number of ACUs specified by the StorageResourceSize parameter × 3 (default value: 24ACU). Each ACU is approximately equal to 1 core and 4 GB memory.

>  This parameter must be specified with a unit.', example='24ACU'),
  storageResourceSize?: string(name='StorageResourceSize', description='The node specifications of reserved storage resources. Valid values: 8ACU, 12ACU, and 16ACU.', example='8ACU'),
}

model MigrateDBClusterResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='F0983B43-B2EC-536A-8791-142B5CF1E9B6'),
}

model MigrateDBClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MigrateDBClusterResponseBody(name='body'),
}

/**
 * @summary Migrates data from a Data Warehouse Edition cluster to a Data Lakehouse Edition cluster in AnalyticDB for MySQL.
 *
 * @param request MigrateDBClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return MigrateDBClusterResponse
 */
async function migrateDBClusterWithOptions(request: MigrateDBClusterRequest, runtime: Util.RuntimeOptions): MigrateDBClusterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.computeResource)) {
    query['ComputeResource'] = request.computeResource;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.productForm)) {
    query['ProductForm'] = request.productForm;
  }
  if (!Util.isUnset(request.productVersion)) {
    query['ProductVersion'] = request.productVersion;
  }
  if (!Util.isUnset(request.reservedNodeCount)) {
    query['ReservedNodeCount'] = request.reservedNodeCount;
  }
  if (!Util.isUnset(request.reservedNodeSize)) {
    query['ReservedNodeSize'] = request.reservedNodeSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.secondaryVSwitchId)) {
    query['SecondaryVSwitchId'] = request.secondaryVSwitchId;
  }
  if (!Util.isUnset(request.secondaryZoneId)) {
    query['SecondaryZoneId'] = request.secondaryZoneId;
  }
  if (!Util.isUnset(request.shardNumber)) {
    query['ShardNumber'] = request.shardNumber;
  }
  if (!Util.isUnset(request.storageResource)) {
    query['StorageResource'] = request.storageResource;
  }
  if (!Util.isUnset(request.storageResourceSize)) {
    query['StorageResourceSize'] = request.storageResourceSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'MigrateDBCluster',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Migrates data from a Data Warehouse Edition cluster to a Data Lakehouse Edition cluster in AnalyticDB for MySQL.
 *
 * @param request MigrateDBClusterRequest
 * @return MigrateDBClusterResponse
 */
async function migrateDBCluster(request: MigrateDBClusterRequest): MigrateDBClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return migrateDBClusterWithOptions(request, runtime);
}

model ModifyAccountDescriptionRequest {
  accountDescription?: string(name='AccountDescription', description='The description of the account. The description must meet the following requirements:

*   The description must start with a letter.
*   The description can contain letters, digits, underscores (_), and hyphens (-).
*   The description cannot start with `http://` or `https://`.
*   The description must be 2 to 256 characters in length.

This parameter is required.', example='AccDesc'),
  accountName?: string(name='AccountName', description='The name of the database account.

This parameter is required.', example='testacc'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyAccountDescriptionResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model ModifyAccountDescriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAccountDescriptionResponseBody(name='body'),
}

/**
 * @summary Modifies the description of a database account for an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyAccountDescriptionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAccountDescriptionResponse
 */
async function modifyAccountDescriptionWithOptions(request: ModifyAccountDescriptionRequest, runtime: Util.RuntimeOptions): ModifyAccountDescriptionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountDescription)) {
    query['AccountDescription'] = request.accountDescription;
  }
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyAccountDescription',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the description of a database account for an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyAccountDescriptionRequest
 * @return ModifyAccountDescriptionResponse
 */
async function modifyAccountDescription(request: ModifyAccountDescriptionRequest): ModifyAccountDescriptionResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyAccountDescriptionWithOptions(request, runtime);
}

model ModifyActiveOperationMaintainConfRequest {
  cycleTime?: string(name='CycleTime', description='The days on which you want to execute O\\\\&M events. Valid values: 1 to 7.', example='1,2,3,4,5,6,7'),
  cycleType?: string(name='CycleType', description='The unit of the O\\\\&M cycle. Set the value to Week.', example='Week'),
  maintainEndTime?: string(name='MaintainEndTime', description='The end time of the maintenance window.', example='02:00:00Z'),
  maintainStartTime?: string(name='MaintainStartTime', description='The start time of the maintenance window.', example='02:00:00Z'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-beijing'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  status?: int32(name='Status', description='Specifies whether to enable O\\\\&M events.

*   1: yes.
*   0: no.', example='1'),
}

model ModifyActiveOperationMaintainConfResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='0A156332-D2AC-5C98-8872-9779EA1CC022'),
}

model ModifyActiveOperationMaintainConfResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyActiveOperationMaintainConfResponseBody(name='body'),
}

/**
 * @summary Changes the time configuration of O\\&M events.
 *
 * @param request ModifyActiveOperationMaintainConfRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyActiveOperationMaintainConfResponse
 */
async function modifyActiveOperationMaintainConfWithOptions(request: ModifyActiveOperationMaintainConfRequest, runtime: Util.RuntimeOptions): ModifyActiveOperationMaintainConfResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cycleTime)) {
    query['CycleTime'] = request.cycleTime;
  }
  if (!Util.isUnset(request.cycleType)) {
    query['CycleType'] = request.cycleType;
  }
  if (!Util.isUnset(request.maintainEndTime)) {
    query['MaintainEndTime'] = request.maintainEndTime;
  }
  if (!Util.isUnset(request.maintainStartTime)) {
    query['MaintainStartTime'] = request.maintainStartTime;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyActiveOperationMaintainConf',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the time configuration of O\\&M events.
 *
 * @param request ModifyActiveOperationMaintainConfRequest
 * @return ModifyActiveOperationMaintainConfResponse
 */
async function modifyActiveOperationMaintainConf(request: ModifyActiveOperationMaintainConfRequest): ModifyActiveOperationMaintainConfResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyActiveOperationMaintainConfWithOptions(request, runtime);
}

model ModifyActiveOperationTasksRequest {
  ids?: string(name='Ids', description='The ID of the O\\\\&M event.', example='1482487'),
  immediateStart?: int32(name='ImmediateStart', description='Specifies whether to immediately execute the O\\\\&M event. Valid values:

*   1: immediately executes the O\\\\&M event.
*   0: executes the O\\\\&M event at a specific point in time.', example='1'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  switchTime?: string(name='SwitchTime', description='The time from which you want to execute the O\\\\&M event.', example='2021-08-15T12:00:00Z'),
}

model ModifyActiveOperationTasksResponseBody = {
  ids?: string(name='Ids', description='The O\\\\&M event IDs that are separated by commas (,).', example='1'),
  requestId?: string(name='RequestId', description='The request ID.', example='8B709A33-5E8D-511F-A225-AFC0B6AAAD76'),
}

model ModifyActiveOperationTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyActiveOperationTasksResponseBody(name='body'),
}

/**
 * @summary Changes the execution time of O&M events.
 *
 * @param request ModifyActiveOperationTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyActiveOperationTasksResponse
 */
async function modifyActiveOperationTasksWithOptions(request: ModifyActiveOperationTasksRequest, runtime: Util.RuntimeOptions): ModifyActiveOperationTasksResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ids)) {
    query['Ids'] = request.ids;
  }
  if (!Util.isUnset(request.immediateStart)) {
    query['ImmediateStart'] = request.immediateStart;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.switchTime)) {
    query['SwitchTime'] = request.switchTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyActiveOperationTasks',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the execution time of O&M events.
 *
 * @param request ModifyActiveOperationTasksRequest
 * @return ModifyActiveOperationTasksResponse
 */
async function modifyActiveOperationTasks(request: ModifyActiveOperationTasksRequest): ModifyActiveOperationTasksResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyActiveOperationTasksWithOptions(request, runtime);
}

model ModifyAuditLogConfigRequest {
  auditLogStatus?: string(name='AuditLogStatus', description='The status of SQL audit. Valid values:

*   **on**: SQL audit is enabled.
*   **off**: SQL audit is disabled.

This parameter is required.', example='on'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the cluster.

This parameter is required.', example='am-t4nj8619bz2w3****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The ID of the region. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyAuditLogConfigResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  updateSucceed?: boolean(name='UpdateSucceed', description='Indicates whether the status of SQL audit is updated. Valid values:

*   **true**: The status of SQL audit is updated.
*   **false**: The status of SQL audit is not updated.', example='true'),
}

model ModifyAuditLogConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAuditLogConfigResponseBody(name='body'),
}

/**
 * @summary 修改审计日志设置
 *
 * @param request ModifyAuditLogConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAuditLogConfigResponse
 */
async function modifyAuditLogConfigWithOptions(request: ModifyAuditLogConfigRequest, runtime: Util.RuntimeOptions): ModifyAuditLogConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.auditLogStatus)) {
    query['AuditLogStatus'] = request.auditLogStatus;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyAuditLogConfig',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改审计日志设置
 *
 * @param request ModifyAuditLogConfigRequest
 * @return ModifyAuditLogConfigResponse
 */
async function modifyAuditLogConfig(request: ModifyAuditLogConfigRequest): ModifyAuditLogConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyAuditLogConfigWithOptions(request, runtime);
}

model ModifyAutoRenewAttributeRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='am-bp1u389j9zjh5****'),
  duration?: string(name='Duration', description='The renewal duration. Default value: **1**.

*   Valid values when PeriodUnit is set to **Month**: 1 to 11.
*   Valid values when PeriodUnit is set to **Year**: 1, 2, 3, and 5.

>  Longer subscription durations offer more savings. Purchasing a cluster for one year is more cost-effective than purchasing the cluster for 10 or 11 months.', example='1'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  periodUnit?: string(name='PeriodUnit', description='The unit of the renewal duration. Default value: **Month**. Valid values:

*   **Year**
*   **Month**', example='Year'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  renewalStatus?: string(name='RenewalStatus', description='The renewal status of the cluster. Valid values:

*   **AutoRenewal**: The cluster is automatically renewed.
*   **Normal**: The cluster is manually renewed.
*   **NotRenewal**: The cluster is not renewed.', example='AutoRenewal'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyAutoRenewAttributeResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='4CE6DF97-AEA4-484F-906F-C407EE3770EB'),
}

model ModifyAutoRenewAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAutoRenewAttributeResponseBody(name='body'),
}

/**
 * @summary Modifies the auto-renewal status of a subscription AnalyticDB for MySQL cluster.
 *
 * @param request ModifyAutoRenewAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyAutoRenewAttributeResponse
 */
async function modifyAutoRenewAttributeWithOptions(request: ModifyAutoRenewAttributeRequest, runtime: Util.RuntimeOptions): ModifyAutoRenewAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.duration)) {
    query['Duration'] = request.duration;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.periodUnit)) {
    query['PeriodUnit'] = request.periodUnit;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.renewalStatus)) {
    query['RenewalStatus'] = request.renewalStatus;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyAutoRenewAttribute',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the auto-renewal status of a subscription AnalyticDB for MySQL cluster.
 *
 * @param request ModifyAutoRenewAttributeRequest
 * @return ModifyAutoRenewAttributeResponse
 */
async function modifyAutoRenewAttribute(request: ModifyAutoRenewAttributeRequest): ModifyAutoRenewAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyAutoRenewAttributeWithOptions(request, runtime);
}

model ModifyBackupPolicyRequest {
  backupRetentionPeriod?: string(name='BackupRetentionPeriod', description='The number of days for which to retain full backup files. Valid values: 7 to 730.

>  If you do not specify this parameter, the default value 7 is used.', example='30'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the cluster.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  enableBackupLog?: string(name='EnableBackupLog', description='Specifies whether to enable real-time log backup. Valid values:

*   **Enable**

*   **Disable**

> If you leave this parameter empty, the default value Enable is used.', example='Enable'),
  logBackupRetentionPeriod?: int32(name='LogBackupRetentionPeriod', description='The number of days for which to retain log backup files. Valid values: 7 to 730.

>  If you do not specify this parameter, the default value 7 is used.', example='30'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  preferredBackupPeriod?: string(name='PreferredBackupPeriod', description='The days of the week on which to perform full backup. Separate multiple values with commas (,). Valid values:

*   **Monday**
*   **Tuesday**
*   **Wednesday**
*   **Thursday**
*   **Friday**
*   **Saturday**
*   **Sunday**

>  To ensure data security, we recommend that you specify at least two values.', example='Monday,Wednesday,Friday,Sunday'),
  preferredBackupTime?: string(name='PreferredBackupTime', description='The start time of the full backup within a time range. Specify the time range in the HH:mmZ-HH:mmZ format. The time must be in UTC.

>  The time range is 1 hour.

This parameter is required.', example='00:00Z-01:00Z'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyBackupPolicyResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model ModifyBackupPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyBackupPolicyResponseBody(name='body'),
}

/**
 * @summary 修改全量备份策略
 *
 * @param request ModifyBackupPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyBackupPolicyResponse
 */
async function modifyBackupPolicyWithOptions(request: ModifyBackupPolicyRequest, runtime: Util.RuntimeOptions): ModifyBackupPolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.backupRetentionPeriod)) {
    query['BackupRetentionPeriod'] = request.backupRetentionPeriod;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.enableBackupLog)) {
    query['EnableBackupLog'] = request.enableBackupLog;
  }
  if (!Util.isUnset(request.logBackupRetentionPeriod)) {
    query['LogBackupRetentionPeriod'] = request.logBackupRetentionPeriod;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.preferredBackupPeriod)) {
    query['PreferredBackupPeriod'] = request.preferredBackupPeriod;
  }
  if (!Util.isUnset(request.preferredBackupTime)) {
    query['PreferredBackupTime'] = request.preferredBackupTime;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyBackupPolicy',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改全量备份策略
 *
 * @param request ModifyBackupPolicyRequest
 * @return ModifyBackupPolicyResponse
 */
async function modifyBackupPolicy(request: ModifyBackupPolicyRequest): ModifyBackupPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyBackupPolicyWithOptions(request, runtime);
}

model ModifyClusterConnectionStringRequest {
  connectionStringPrefix?: string(name='ConnectionStringPrefix', description='The prefix of the public endpoint.

*   The prefix can contain lowercase letters, digits, and hyphens (-). It must start with a lowercase letter.
*   The prefix can be up to 30 characters in length.

This parameter is required.', example='test-123'),
  currentConnectionString?: string(name='CurrentConnectionString', description='The current public endpoint of the AnalyticDB for MySQL Data Warehouse Edition cluster.

>  You can call the [DescribeDBClusterNetInfo](https://help.aliyun.com/document_detail/143384.html) operation to query the public endpoint of the cluster.

This parameter is required.', example='am-bp18934i73vb****.ads.aliyuncs.com'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a region.

This parameter is required.', example='am-bp18934i73vb****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  port?: int32(name='Port', description='The port number. Set the value to **3306**.', example='3306'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyClusterConnectionStringResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='370D09FD-442A-5225-AAD3-7362CAE39177'),
}

model ModifyClusterConnectionStringResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyClusterConnectionStringResponseBody(name='body'),
}

/**
 * @summary Changes the endpoint of an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyClusterConnectionStringRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyClusterConnectionStringResponse
 */
async function modifyClusterConnectionStringWithOptions(request: ModifyClusterConnectionStringRequest, runtime: Util.RuntimeOptions): ModifyClusterConnectionStringResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.connectionStringPrefix)) {
    query['ConnectionStringPrefix'] = request.connectionStringPrefix;
  }
  if (!Util.isUnset(request.currentConnectionString)) {
    query['CurrentConnectionString'] = request.currentConnectionString;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.port)) {
    query['Port'] = request.port;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyClusterConnectionString',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the endpoint of an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyClusterConnectionStringRequest
 * @return ModifyClusterConnectionStringResponse
 */
async function modifyClusterConnectionString(request: ModifyClusterConnectionStringRequest): ModifyClusterConnectionStringResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyClusterConnectionStringWithOptions(request, runtime);
}

model ModifyDBClusterRequest {
  computeResource?: string(name='ComputeResource', description='The computing resources of the cluster. You can call the [DescribeAvailableResource](https://help.aliyun.com/document_detail/190632.html) operation to query the computing resources that are available within a region.

> This parameter must be specified when Mode is set to Flexible.', example='32Core128GBNEW'),
  DBClusterCategory?: string(name='DBClusterCategory', description='The edition of the cluster. Valid values:

*   **Cluster**: reserved mode for Cluster Edition.
*   **MixedStorage**: elastic mode for Cluster Edition.

> If you set DBClusterCategory to Cluster, you must set Mode to Reserver. If you set DBClusterCategory to MixedStorage, you must set Mode to Flexible. Otherwise, you fail to change the specifications of the cluster.', example='MixedStorage'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

This parameter is required.', example='am-bp1u8c0mgfg58****'),
  DBNodeClass?: string(name='DBNodeClass', description='The node specifications of the cluster. Valid values:

*   **C8**
*   **C32**

> This parameter must be specified when Mode is set to Reserver.', example='C32'),
  DBNodeGroupCount?: string(name='DBNodeGroupCount', description='The number of node groups. Valid values: 1 to 200.

> This parameter must be specified when Mode is set to Reserver.', example='2'),
  DBNodeStorage?: string(name='DBNodeStorage', description='The storage capacity per node. Unit: GB.

*   Valid values when DBClusterClass is set to C8: 100 to 2000.
*   Valid values when DBClusterClass is set to C32: 100 to 8000.

> 

*   This parameter must be specified when Mode is set to Reserver.

*   The storage capacity less than 1,000 GB increases in 100 GB increments. The storage capacity greater than 1,000 GB increases in 1,000 GB increments.', example='200'),
  diskPerformanceLevel?: string(name='DiskPerformanceLevel', description='The Enterprise SSD (ESSD) performance level of the cluster. Valid values:

*   PL0
*   PL1
*   PL2
*   PL3', example='PL1'),
  elasticIOResource?: int32(name='ElasticIOResource', description='The number of EIUs. The number of EIUs that you can purchase varies based on the single-node EIU specifications.

*   If the single-node EIU specifications are 8 cores and 64 GB, you can purchase up to 32 EIUs.
*   If the single-node EIU specifications are 12 cores and 96 GB, you can purchase up to 16 EIUs.', example='2'),
  elasticIOResourceSize?: string(name='ElasticIOResourceSize', description='The single-node specifications of an elastic I/O unit (EIU). Valid values:

*   **8Core64GB**: If you set the parameter to **8Core64GB**, the specifications of an EIU are 24 cores and 192 GB memory.
*   **12Core96GB**: If you set the parameter to **12Core96GB**, the specifications of an EIU are 36 cores and 288 GB memory.

>  This parameter takes effect only when your cluster meets the following requirements:

*   The cluster is in elastic mode.

*   If the cluster resides in the China (Guangzhou), China (Shenzhen), China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), or China (Zhangjiakou) region, the cluster has 16 cores and 64 GB memory or higher specifications.

*   If the cluster resides in another region, the cluster has 32 cores and 128 GB memory or higher specifications.', example='8Core64GB'),
  executorCount?: string(name='ExecutorCount', description='N/A', example='None'),
  mode?: string(name='Mode', description='The mode of the cluster. Valid values:

*   **Reserver**: the reserved mode.
*   **Flexible**: the elastic mode.', example='Flexible'),
  modifyType?: string(name='ModifyType', description='The change type. Valid values:

*   **Upgrade**
*   **Downgrade**', example='Upgrade'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  storageResource?: string(name='StorageResource', description='N/A', example='None'),
}

model ModifyDBClusterResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-bp1u8c0mgfg58****'),
  orderId?: string(name='OrderId', description='The order ID.', example='2035629****'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model ModifyDBClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBClusterResponseBody(name='body'),
}

/**
 * @summary Changes the specifications of an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyDBClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBClusterResponse
 */
async function modifyDBClusterWithOptions(request: ModifyDBClusterRequest, runtime: Util.RuntimeOptions): ModifyDBClusterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.computeResource)) {
    query['ComputeResource'] = request.computeResource;
  }
  if (!Util.isUnset(request.DBClusterCategory)) {
    query['DBClusterCategory'] = request.DBClusterCategory;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.DBNodeClass)) {
    query['DBNodeClass'] = request.DBNodeClass;
  }
  if (!Util.isUnset(request.DBNodeGroupCount)) {
    query['DBNodeGroupCount'] = request.DBNodeGroupCount;
  }
  if (!Util.isUnset(request.DBNodeStorage)) {
    query['DBNodeStorage'] = request.DBNodeStorage;
  }
  if (!Util.isUnset(request.diskPerformanceLevel)) {
    query['DiskPerformanceLevel'] = request.diskPerformanceLevel;
  }
  if (!Util.isUnset(request.elasticIOResource)) {
    query['ElasticIOResource'] = request.elasticIOResource;
  }
  if (!Util.isUnset(request.elasticIOResourceSize)) {
    query['ElasticIOResourceSize'] = request.elasticIOResourceSize;
  }
  if (!Util.isUnset(request.executorCount)) {
    query['ExecutorCount'] = request.executorCount;
  }
  if (!Util.isUnset(request.mode)) {
    query['Mode'] = request.mode;
  }
  if (!Util.isUnset(request.modifyType)) {
    query['ModifyType'] = request.modifyType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.storageResource)) {
    query['StorageResource'] = request.storageResource;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBCluster',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the specifications of an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyDBClusterRequest
 * @return ModifyDBClusterResponse
 */
async function modifyDBCluster(request: ModifyDBClusterRequest): ModifyDBClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBClusterWithOptions(request, runtime);
}

model ModifyDBClusterAccessWhiteListRequest {
  DBClusterIPArrayAttribute?: string(name='DBClusterIPArrayAttribute', description='The attribute of the IP address whitelist. By default, this parameter is empty. The IP address whitelists that have the **hidden** attribute are not displayed in the console. These IP address whitelists are used to access services such as Data Transmission Service (DTS) and PolarDB-X.', example='hidden'),
  DBClusterIPArrayName?: string(name='DBClusterIPArrayName', description='The name of the IP address whitelist that you want to modify. Default value: **Default**. The name of an IP address whitelist must be 2 to 32 characters in length. The name can contain lowercase letters, digits, and underscores (_). The name must start with a lowercase letter and end with a lowercase letter or digit.

Each cluster supports up to 50 IP address whitelists.', example='test'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='rm-uf6wjk5xxxxxxxxxx'),
  modifyMode?: string(name='ModifyMode', description='The method that you want to use to modify the IP address whitelist. Valid values:

*   Cover: overwrites the IP address whitelist.
*   Append: adds IP addresses to the IP address whitelist.
*   Delete: removes IP addresses from the IP address whitelist.

Default value: Cover.', example='Cover'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityIps?: string(name='SecurityIps', description='The IP addresses that you want to use to modify the IP address whitelist of the cluster. Separate multiple IP addresses with commas (,). You can specify up to 500 distinct IP addresses. The following formats are supported:

*   IP address. Example: 10.23.12.24.
*   CIDR block. Example: 10.23.12.24/24. In this example, 24 indicates that the prefix of the CIDR block is 24 bits in length. You can replace 24 with a value that ranges from 1 to 32.

>  This parameter must be specified unless ModifyMode is set to Delete.

This parameter is required.', example='10.23.12.24'),
}

model ModifyDBClusterAccessWhiteListResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='rm-uf6wjk5xxxxxxxxxx'),
  requestId?: string(name='RequestId', description='The request ID.', example='D0CEC6AC-7760-409A-A0D5-E6CD8660E9CC'),
  taskId?: int32(name='TaskId', description='The task ID.', example='1564657730'),
}

model ModifyDBClusterAccessWhiteListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBClusterAccessWhiteListResponseBody(name='body'),
}

/**
 * @summary Modifies the IP address whitelists of a cluster.
 *
 * @param request ModifyDBClusterAccessWhiteListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBClusterAccessWhiteListResponse
 */
async function modifyDBClusterAccessWhiteListWithOptions(request: ModifyDBClusterAccessWhiteListRequest, runtime: Util.RuntimeOptions): ModifyDBClusterAccessWhiteListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterIPArrayAttribute)) {
    query['DBClusterIPArrayAttribute'] = request.DBClusterIPArrayAttribute;
  }
  if (!Util.isUnset(request.DBClusterIPArrayName)) {
    query['DBClusterIPArrayName'] = request.DBClusterIPArrayName;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.modifyMode)) {
    query['ModifyMode'] = request.modifyMode;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.securityIps)) {
    query['SecurityIps'] = request.securityIps;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBClusterAccessWhiteList',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the IP address whitelists of a cluster.
 *
 * @param request ModifyDBClusterAccessWhiteListRequest
 * @return ModifyDBClusterAccessWhiteListResponse
 */
async function modifyDBClusterAccessWhiteList(request: ModifyDBClusterAccessWhiteListRequest): ModifyDBClusterAccessWhiteListResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBClusterAccessWhiteListWithOptions(request, runtime);
}

model ModifyDBClusterDescriptionRequest {
  DBClusterDescription?: string(name='DBClusterDescription', description='The description of the cluster.

*   The description cannot start with `http://` or `https`.
*   The description must be 2 to 256 characters in length.

This parameter is required.', example='adb_test'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the cluster.

This parameter is required.', example='am-bp11q28kvl688****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyDBClusterDescriptionResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='17F57FEE-EA4F-4337-8D2E-9C23CAA63D74'),
}

model ModifyDBClusterDescriptionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBClusterDescriptionResponseBody(name='body'),
}

/**
 * @summary 修改备注
 *
 * @param request ModifyDBClusterDescriptionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBClusterDescriptionResponse
 */
async function modifyDBClusterDescriptionWithOptions(request: ModifyDBClusterDescriptionRequest, runtime: Util.RuntimeOptions): ModifyDBClusterDescriptionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterDescription)) {
    query['DBClusterDescription'] = request.DBClusterDescription;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBClusterDescription',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改备注
 *
 * @param request ModifyDBClusterDescriptionRequest
 * @return ModifyDBClusterDescriptionResponse
 */
async function modifyDBClusterDescription(request: ModifyDBClusterDescriptionRequest): ModifyDBClusterDescriptionResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBClusterDescriptionWithOptions(request, runtime);
}

model ModifyDBClusterMaintainTimeRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL clusters within a region.

This parameter is required.', example='am-bp111m2cfrdl****'),
  maintainTime?: string(name='MaintainTime', description='The maintenance window of the cluster. Specify the maintenance window in the hh:mmZ-hh:mmZ format.

>  The time range must be 1 hour and start and end at the beginning of an hour.

This parameter is required.', example='22:00Z-23:00Z'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyDBClusterMaintainTimeResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='65BDA532-28AF-4122-AA39-B382721EEE64'),
}

model ModifyDBClusterMaintainTimeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBClusterMaintainTimeResponseBody(name='body'),
}

/**
 * @summary Changes the maintenance window of an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyDBClusterMaintainTimeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBClusterMaintainTimeResponse
 */
async function modifyDBClusterMaintainTimeWithOptions(request: ModifyDBClusterMaintainTimeRequest, runtime: Util.RuntimeOptions): ModifyDBClusterMaintainTimeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.maintainTime)) {
    query['MaintainTime'] = request.maintainTime;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBClusterMaintainTime',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the maintenance window of an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyDBClusterMaintainTimeRequest
 * @return ModifyDBClusterMaintainTimeResponse
 */
async function modifyDBClusterMaintainTime(request: ModifyDBClusterMaintainTimeRequest): ModifyDBClusterMaintainTimeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBClusterMaintainTimeWithOptions(request, runtime);
}

model ModifyDBClusterPayTypeRequest {
  dbClusterId?: string(name='DbClusterId', description='The cluster ID.

This parameter is required.', example='am-bp11q28kvl688****'),
  payType?: string(name='PayType', description='The billing method. Valid values:

*   **Postpaid**: pay-as-you-go.
*   **Prepaid**: subscription.

This parameter is required.', example='Prepaid'),
  period?: string(name='Period', description='The subscription type of the subscription cluster. Valid values:

*   **Year**: subscription on a yearly basis.
*   **Month**: subscription on a monthly basis.

> This parameter must be specified when PayType is set to Prepaid.', example='Year'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.', example='cn-hangzhou'),
  usedTime?: string(name='UsedTime', description='The subscription duration of the subscription cluster.

*   Valid values when Period is set to Year: 1, 2, 3, and 5 (integer).
*   Valid values when Period is set to Month: 1 to 11 (integer).

> 

*   This parameter must be specified when PayType is set to Prepaid.

*   Longer subscription durations offer more savings. Purchasing a cluster for one year is more cost-effective than purchasing the cluster for 10 or 11 months.', example='1'),
}

model ModifyDBClusterPayTypeResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='am-bp11q28kvl688****'),
  orderId?: string(name='OrderId', description='The order ID.', example='2023532****'),
  payType?: string(name='PayType', description='The billing method. Valid values:

*   **Postpaid**: pay-as-you-go.
*   **Prepaid**: subscription.', example='Prepaid'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model ModifyDBClusterPayTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBClusterPayTypeResponseBody(name='body'),
}

/**
 * @summary Changes the billing method of an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyDBClusterPayTypeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBClusterPayTypeResponse
 */
async function modifyDBClusterPayTypeWithOptions(request: ModifyDBClusterPayTypeRequest, runtime: Util.RuntimeOptions): ModifyDBClusterPayTypeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dbClusterId)) {
    query['DbClusterId'] = request.dbClusterId;
  }
  if (!Util.isUnset(request.payType)) {
    query['PayType'] = request.payType;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.usedTime)) {
    query['UsedTime'] = request.usedTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBClusterPayType',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the billing method of an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyDBClusterPayTypeRequest
 * @return ModifyDBClusterPayTypeResponse
 */
async function modifyDBClusterPayType(request: ModifyDBClusterPayTypeRequest): ModifyDBClusterPayTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBClusterPayTypeWithOptions(request, runtime);
}

model ModifyDBClusterResourceGroupRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-bpxxxxx'),
  newResourceGroupId?: string(name='NewResourceGroupId', description='The resource group ID. For more information, see [View basic information of a resource group](https://help.aliyun.com/document_detail/151181.html).

This parameter is required.', example='rg-acxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyDBClusterResourceGroupResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='65BDA532-28AF-4122-AA39-B382721EEE64'),
}

model ModifyDBClusterResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBClusterResourceGroupResponseBody(name='body'),
}

/**
 * @summary Modifies the resource group of an AnalyticDB for MySQL cluster.
 *
 * @description Resource Management enables you to build an organizational structure for resources based on your business needs. You can use a resource directory, folders, accounts, and resource groups to hierarchically organize and manage resources. For more information, see [What is Resource Management?](~~94475#concept-zyn-3p1-dhb~~ "Resource Management provides a collection of resource management services that support enterprise IT administration. The services include Resource Directory, Resource Group, and Tag. Resource Directory allows you to build an organizational structure for resources based on your business requirements. Resource Group and Tag allow you to hierarchically manage the resources. Resource Sharing allows you to share the resources among your accounts.")
 *
 * @param request ModifyDBClusterResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBClusterResourceGroupResponse
 */
async function modifyDBClusterResourceGroupWithOptions(request: ModifyDBClusterResourceGroupRequest, runtime: Util.RuntimeOptions): ModifyDBClusterResourceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.newResourceGroupId)) {
    query['NewResourceGroupId'] = request.newResourceGroupId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBClusterResourceGroup',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the resource group of an AnalyticDB for MySQL cluster.
 *
 * @description Resource Management enables you to build an organizational structure for resources based on your business needs. You can use a resource directory, folders, accounts, and resource groups to hierarchically organize and manage resources. For more information, see [What is Resource Management?](~~94475#concept-zyn-3p1-dhb~~ "Resource Management provides a collection of resource management services that support enterprise IT administration. The services include Resource Directory, Resource Group, and Tag. Resource Directory allows you to build an organizational structure for resources based on your business requirements. Resource Group and Tag allow you to hierarchically manage the resources. Resource Sharing allows you to share the resources among your accounts.")
 *
 * @param request ModifyDBClusterResourceGroupRequest
 * @return ModifyDBClusterResourceGroupResponse
 */
async function modifyDBClusterResourceGroup(request: ModifyDBClusterResourceGroupRequest): ModifyDBClusterResourceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBClusterResourceGroupWithOptions(request, runtime);
}

model ModifyDBClusterSSLRequest {
  connectionString?: string(name='ConnectionString', description='The internal or public endpoint for which the server certificate needs to be created or updated.', example='am-d7oualxo05x4o5be872***.ads.aliyuncs.com'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of AnalyticDB for MySQL Data Warehouse Edition clusters within a region.

This parameter is required.', example='am-bp1r053byu48p****'),
  enableSSL?: boolean(name='EnableSSL', description='Specifies whether to enable SSL encryption. Valid values:

*   true
*   false

This parameter is required.', example='true'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyDBClusterSSLResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model ModifyDBClusterSSLResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBClusterSSLResponseBody(name='body'),
}

/**
 * @summary Modifies the SSL configurations of an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.
 *
 * @param request ModifyDBClusterSSLRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBClusterSSLResponse
 */
async function modifyDBClusterSSLWithOptions(request: ModifyDBClusterSSLRequest, runtime: Util.RuntimeOptions): ModifyDBClusterSSLResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.connectionString)) {
    query['ConnectionString'] = request.connectionString;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.enableSSL)) {
    query['EnableSSL'] = request.enableSSL;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBClusterSSL',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the SSL configurations of an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.
 *
 * @param request ModifyDBClusterSSLRequest
 * @return ModifyDBClusterSSLResponse
 */
async function modifyDBClusterSSL(request: ModifyDBClusterSSLRequest): ModifyDBClusterSSLResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBClusterSSLWithOptions(request, runtime);
}

model ModifyDBClusterShardNumberRequest {
  DBClusterId?: string(name='DBClusterId', description='This parameter is required.', example='amv-bp1xxxxxxxx47'),
  dryRun?: boolean(name='DryRun', example='false'),
  newShardNumber?: long(name='NewShardNumber', example='256'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  switchTime?: string(name='SwitchTime', example='2021-07-09T22:00:00Z'),
  switchTimeMode?: long(name='SwitchTimeMode', example='Immediate'),
}

model ModifyDBClusterShardNumberResponseBody = {
  requestId?: string(name='RequestId', example='25B56BC7-4978-40B3-9E48-4B7067******'),
}

model ModifyDBClusterShardNumberResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBClusterShardNumberResponseBody(name='body'),
}

/**
 * @summary 修改实例分片数目
 *
 * @param request ModifyDBClusterShardNumberRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBClusterShardNumberResponse
 */
async function modifyDBClusterShardNumberWithOptions(request: ModifyDBClusterShardNumberRequest, runtime: Util.RuntimeOptions): ModifyDBClusterShardNumberResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.newShardNumber)) {
    query['NewShardNumber'] = request.newShardNumber;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.switchTime)) {
    query['SwitchTime'] = request.switchTime;
  }
  if (!Util.isUnset(request.switchTimeMode)) {
    query['SwitchTimeMode'] = request.switchTimeMode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBClusterShardNumber',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改实例分片数目
 *
 * @param request ModifyDBClusterShardNumberRequest
 * @return ModifyDBClusterShardNumberResponse
 */
async function modifyDBClusterShardNumber(request: ModifyDBClusterShardNumberRequest): ModifyDBClusterShardNumberResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBClusterShardNumberWithOptions(request, runtime);
}

model ModifyDBClusterVipRequest {
  connectionString?: string(name='ConnectionString', description='The internal or public endpoint for which the server certificate needs to be created or updated.', example='am-2ze8mbuai974s4y2500000169.ads.aliyuncs.com'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the cluster IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a specific region.

This parameter is required.', example='am-2ze8mbuai97*****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster.', example='cn-beijing'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  VPCId?: string(name='VPCId', description='The virtual private cloud (VPC) ID of the cluster.

This parameter is required.', example='vpc-bp1at5ze0t5u3xtqn****'),
  vSwitchId?: string(name='VSwitchId', description='The vSwitch ID of the cluster.

This parameter is required.', example='vsw-bp1aadw9k19x6cis9****'),
}

model ModifyDBClusterVipResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-****-4A42-BF6D-8A4442913CEF'),
  taskId?: string(name='TaskId', description='The task ID.', example='1564657730'),
}

model ModifyDBClusterVipResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBClusterVipResponseBody(name='body'),
}

/**
 * @summary Changes the virtual IP address (VIP) that is used to connect to an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyDBClusterVipRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBClusterVipResponse
 */
async function modifyDBClusterVipWithOptions(request: ModifyDBClusterVipRequest, runtime: Util.RuntimeOptions): ModifyDBClusterVipResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.connectionString)) {
    query['ConnectionString'] = request.connectionString;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.VPCId)) {
    query['VPCId'] = request.VPCId;
  }
  if (!Util.isUnset(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBClusterVip',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the virtual IP address (VIP) that is used to connect to an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyDBClusterVipRequest
 * @return ModifyDBClusterVipResponse
 */
async function modifyDBClusterVip(request: ModifyDBClusterVipRequest): ModifyDBClusterVipResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBClusterVipWithOptions(request, runtime);
}

model ModifyDBResourceGroupRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='123e4567-e89b-12d3-a456-t7241****'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the cluster IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a specific region.

This parameter is required.', example='am-bp1ub9grke1****'),
  groupName?: string(name='GroupName', description='The name of the resource group.

This parameter is required.', example='test_group'),
  groupType?: string(name='GroupType', description='The query execution mode. Valid values:

*   **interactive**
*   **batch**

>  For more information, see [Query execution modes](https://help.aliyun.com/document_detail/189502.html).', example='batch'),
  nodeNum?: int32(name='NodeNum', description='The number of nodes. Default value: 0.

*   Each node is configured with the resources of 16 cores and 64 GB memory.
*   Make sure that the amount of resources of the nodes (Number of nodes × 16 cores and 64 GB memory) is less than or equal to the amount of unused resources of the cluster.', example='1'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  poolUserList?: [ string ](name='PoolUserList', description='The database accounts with which to associate the resource group. They can be standard accounts or privileged accounts.'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyDBResourceGroupShrinkRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='123e4567-e89b-12d3-a456-t7241****'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the cluster IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a specific region.

This parameter is required.', example='am-bp1ub9grke1****'),
  groupName?: string(name='GroupName', description='The name of the resource group.

This parameter is required.', example='test_group'),
  groupType?: string(name='GroupType', description='The query execution mode. Valid values:

*   **interactive**
*   **batch**

>  For more information, see [Query execution modes](https://help.aliyun.com/document_detail/189502.html).', example='batch'),
  nodeNum?: int32(name='NodeNum', description='The number of nodes. Default value: 0.

*   Each node is configured with the resources of 16 cores and 64 GB memory.
*   Make sure that the amount of resources of the nodes (Number of nodes × 16 cores and 64 GB memory) is less than or equal to the amount of unused resources of the cluster.', example='1'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  poolUserListShrink?: string(name='PoolUserList', description='The database accounts with which to associate the resource group. They can be standard accounts or privileged accounts.'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyDBResourceGroupResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model ModifyDBResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBResourceGroupResponseBody(name='body'),
}

/**
 * @summary Modifies the number of nodes or the query execution mode for a resource group of an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.
 *
 * @description ## Precautions
 * *   This operation is applicable only for elastic clusters of 32 cores or more.
 * *   The number of nodes cannot be changed for the default resource group USER_DEFAULT.
 *
 * @param tmpReq ModifyDBResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBResourceGroupResponse
 */
async function modifyDBResourceGroupWithOptions(tmpReq: ModifyDBResourceGroupRequest, runtime: Util.RuntimeOptions): ModifyDBResourceGroupResponse {
  Util.validateModel(tmpReq);
  var request = new ModifyDBResourceGroupShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.poolUserList)) {
    request.poolUserListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.poolUserList, 'PoolUserList', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.groupType)) {
    query['GroupType'] = request.groupType;
  }
  if (!Util.isUnset(request.nodeNum)) {
    query['NodeNum'] = request.nodeNum;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.poolUserListShrink)) {
    query['PoolUserList'] = request.poolUserListShrink;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBResourceGroup',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the number of nodes or the query execution mode for a resource group of an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.
 *
 * @description ## Precautions
 * *   This operation is applicable only for elastic clusters of 32 cores or more.
 * *   The number of nodes cannot be changed for the default resource group USER_DEFAULT.
 *
 * @param request ModifyDBResourceGroupRequest
 * @return ModifyDBResourceGroupResponse
 */
async function modifyDBResourceGroup(request: ModifyDBResourceGroupRequest): ModifyDBResourceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBResourceGroupWithOptions(request, runtime);
}

model ModifyDBResourcePoolRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='am-bp1ub9grke1****'),
  nodeNum?: int32(name='NodeNum', description='The number of nodes.

*   Each node provides 16 cores and 64 GB memory.
*   The amount of resources that you want to add to or remove from the cluster cannot exceed the total amount of resources in the cluster.

> - If you do not specify this parameter, the original value is retained.
> - You must specify at least one of the QueryType and NodeNum parameters.', example='2'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  poolName?: string(name='PoolName', description='The name of the resource group.

This parameter is required.', example='test_group'),
  queryType?: string(name='QueryType', description='The mode in which SQL statements are executed. Valid values:

*   **batch**
*   **interactive**

> If you do not specify this parameter, the original value is retained.', example='batch'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyDBResourcePoolResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model ModifyDBResourcePoolResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBResourcePoolResponseBody(name='body'),
}

/**
 * @summary Modifies the resources of a resource group. This operation is available only for AnalyticDB for MySQL clusters in elastic mode for Cluster Edition.
 *
 * @description ###
 * *   You can call this operation only for elastic clusters of 32 cores or more.
 * *   You cannot change the number of nodes for the USER_DEFAULT resource group.
 *
 * @param request ModifyDBResourcePoolRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBResourcePoolResponse
 */
async function modifyDBResourcePoolWithOptions(request: ModifyDBResourcePoolRequest, runtime: Util.RuntimeOptions): ModifyDBResourcePoolResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.nodeNum)) {
    query['NodeNum'] = request.nodeNum;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.poolName)) {
    query['PoolName'] = request.poolName;
  }
  if (!Util.isUnset(request.queryType)) {
    query['QueryType'] = request.queryType;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBResourcePool',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the resources of a resource group. This operation is available only for AnalyticDB for MySQL clusters in elastic mode for Cluster Edition.
 *
 * @description ###
 * *   You can call this operation only for elastic clusters of 32 cores or more.
 * *   You cannot change the number of nodes for the USER_DEFAULT resource group.
 *
 * @param request ModifyDBResourcePoolRequest
 * @return ModifyDBResourcePoolResponse
 */
async function modifyDBResourcePool(request: ModifyDBResourcePoolRequest): ModifyDBResourcePoolResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBResourcePoolWithOptions(request, runtime);
}

model ModifyElasticPlanRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='am-bp1rqvm70uh2v****'),
  elasticPlanEnable?: boolean(name='ElasticPlanEnable', description='Specifies whether the scaling plan takes effect. Valid values:

*   **true** (default)
*   **false**', example='true'),
  elasticPlanEndDay?: string(name='ElasticPlanEndDay', description='The end date of the scaling plan. Specify the date in the yyyy-MM-dd format.', example='2022-12-09'),
  elasticPlanMonthlyRepeat?: string(name='ElasticPlanMonthlyRepeat', description='The dates of the month when you want to execute the scaling plan. A number specifies a date of the month. Separate multiple values with commas (,).', example='1,15,25'),
  elasticPlanName?: string(name='ElasticPlanName', description='The name of the scaling plan.

*   The name must be 2 to 30 characters in length.
*   The name can contain letters, digits, and underscores (_).

> You can call the [DescribeElasticPlan](https://help.aliyun.com/document_detail/190596.html) operation to query the information about all scaling plans of a cluster, including the scaling plan names.

This parameter is required.', example='realtime'),
  elasticPlanNodeNum?: int32(name='ElasticPlanNodeNum', description='The number of nodes that are involved in the scaling plan.

*   If ElasticPlanType is set to **worker**, you can set this parameter to 0 or leave this parameter empty.
*   If ElasticPlanType is set to **executorcombineworker** or **executor**, you must set this parameter to a value that is greater than 0.', example='0'),
  elasticPlanStartDay?: string(name='ElasticPlanStartDay', description='The start date of the scaling plan. Specify the date in the yyyy-MM-dd format.', example='2022-12-02'),
  elasticPlanTimeEnd?: string(name='ElasticPlanTimeEnd', description='The restoration time of the scaling plan. Specify the time on the hour in the HH:mm:ss format. The interval between the scale-up time and the restoration time cannot be more than 24 hours.', example='10:00:00'),
  elasticPlanTimeStart?: string(name='ElasticPlanTimeStart', description='The scale-up time of the scaling plan. Specify the time on the hour in the HH:mm:ss format.', example='8:00:00'),
  elasticPlanType?: string(name='ElasticPlanType', description='The type of the scaling plan. Valid values:

*   **worker**: scales only elastic I/O resources.
*   **executor**: scales only computing resources.
*   **executorcombineworker** (default): scales both elastic I/O resources and computing resources by proportion.

> 

*   If you want to set this parameter to **executorcombineworker**, make sure that the cluster runs a minor version of 3.1.3.2 or later.

*   If you want to set this parameter to **worker** or **executor**, make sure that the cluster runs a minor version of 3.1.6.1 or later and a ticket is submitted. After your request is approved, you can set this parameter to **worker** or **executor**.', example='worker'),
  elasticPlanWeeklyRepeat?: string(name='ElasticPlanWeeklyRepeat', description='The days of the week when you want to execute the scaling plan. Valid values: 0 to 6, which indicate Sunday to Saturday. Separate multiple values with commas (,).', example='1,2,3,4,5'),
  elasticPlanWorkerSpec?: string(name='ElasticPlanWorkerSpec', description='The resource specifications that can be scaled up by the scaling plan. Valid values:

*   8 Core 64 GB (default)
*   16 Core 64 GB
*   32 Core 64 GB
*   64 Core 128 GB
*   12 Core 96 GB
*   24 Core 96 GB
*   52 Core 86 GB', example='16 Core 64 GB'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourcePoolName?: string(name='ResourcePoolName', description='The name of the resource group.

>  You can call the [DescribeDBResourceGroup](https://help.aliyun.com/document_detail/466685.html) operation to query the resource group name.', example='test'),
}

model ModifyElasticPlanResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model ModifyElasticPlanResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyElasticPlanResponseBody(name='body'),
}

/**
 * @summary Modifies a scheduled scaling plan. This operation can be used only for AnalyticDB for MySQL clusters in elastic mode for Cluster Edition.
 *
 * @description You can call this operation only for AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters in elastic mode for Cluster Edition that have 32 cores or more.
 *
 * @param request ModifyElasticPlanRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyElasticPlanResponse
 */
async function modifyElasticPlanWithOptions(request: ModifyElasticPlanRequest, runtime: Util.RuntimeOptions): ModifyElasticPlanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.elasticPlanEnable)) {
    query['ElasticPlanEnable'] = request.elasticPlanEnable;
  }
  if (!Util.isUnset(request.elasticPlanEndDay)) {
    query['ElasticPlanEndDay'] = request.elasticPlanEndDay;
  }
  if (!Util.isUnset(request.elasticPlanMonthlyRepeat)) {
    query['ElasticPlanMonthlyRepeat'] = request.elasticPlanMonthlyRepeat;
  }
  if (!Util.isUnset(request.elasticPlanName)) {
    query['ElasticPlanName'] = request.elasticPlanName;
  }
  if (!Util.isUnset(request.elasticPlanNodeNum)) {
    query['ElasticPlanNodeNum'] = request.elasticPlanNodeNum;
  }
  if (!Util.isUnset(request.elasticPlanStartDay)) {
    query['ElasticPlanStartDay'] = request.elasticPlanStartDay;
  }
  if (!Util.isUnset(request.elasticPlanTimeEnd)) {
    query['ElasticPlanTimeEnd'] = request.elasticPlanTimeEnd;
  }
  if (!Util.isUnset(request.elasticPlanTimeStart)) {
    query['ElasticPlanTimeStart'] = request.elasticPlanTimeStart;
  }
  if (!Util.isUnset(request.elasticPlanType)) {
    query['ElasticPlanType'] = request.elasticPlanType;
  }
  if (!Util.isUnset(request.elasticPlanWeeklyRepeat)) {
    query['ElasticPlanWeeklyRepeat'] = request.elasticPlanWeeklyRepeat;
  }
  if (!Util.isUnset(request.elasticPlanWorkerSpec)) {
    query['ElasticPlanWorkerSpec'] = request.elasticPlanWorkerSpec;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourcePoolName)) {
    query['ResourcePoolName'] = request.resourcePoolName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyElasticPlan',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies a scheduled scaling plan. This operation can be used only for AnalyticDB for MySQL clusters in elastic mode for Cluster Edition.
 *
 * @description You can call this operation only for AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters in elastic mode for Cluster Edition that have 32 cores or more.
 *
 * @param request ModifyElasticPlanRequest
 * @return ModifyElasticPlanResponse
 */
async function modifyElasticPlan(request: ModifyElasticPlanRequest): ModifyElasticPlanResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyElasticPlanWithOptions(request, runtime);
}

model ModifyLogBackupPolicyRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  enableBackupLog?: string(name='EnableBackupLog', description='Specifies whether to enable log backup. Valid values:

*   **Enable**
*   **Disable**

This parameter is required.', example='Enable'),
  logBackupRetentionPeriod?: string(name='LogBackupRetentionPeriod', description='The number of days for which to retain log backup files. Valid values: 7 to 730.

>  If you do not specify this parameter, the default value 7 is used.', example='30'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-acfm4f7oger****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyLogBackupPolicyResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model ModifyLogBackupPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyLogBackupPolicyResponseBody(name='body'),
}

/**
 * @summary Modifies the log backup settings of an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyLogBackupPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyLogBackupPolicyResponse
 */
async function modifyLogBackupPolicyWithOptions(request: ModifyLogBackupPolicyRequest, runtime: Util.RuntimeOptions): ModifyLogBackupPolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.enableBackupLog)) {
    query['EnableBackupLog'] = request.enableBackupLog;
  }
  if (!Util.isUnset(request.logBackupRetentionPeriod)) {
    query['LogBackupRetentionPeriod'] = request.logBackupRetentionPeriod;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyLogBackupPolicy',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the log backup settings of an AnalyticDB for MySQL cluster.
 *
 * @param request ModifyLogBackupPolicyRequest
 * @return ModifyLogBackupPolicyResponse
 */
async function modifyLogBackupPolicy(request: ModifyLogBackupPolicyRequest): ModifyLogBackupPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyLogBackupPolicyWithOptions(request, runtime);
}

model ModifyLogHubStatusRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a region.

This parameter is required.', example='am-uf6j8370er80m6wf3'),
  deliverName?: string(name='DeliverName', description='The name of the log shipping job.

This parameter is required.', example='loghub-mnp-report'),
  logStoreName?: string(name='LogStoreName', description='The name of the Logstore.

This parameter is required.', example='pay-notify-wx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  projectName?: string(name='ProjectName', description='The name of the Simple Log Service project.

This parameter is required.', example='test-adb'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  status?: string(name='Status', description='The status of the log shipping job.

Valid values:

*   Delete
*   Pause
*   Restart

This parameter is required.', example='Pause'),
}

model ModifyLogHubStatusResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='0AA1F421-395B-5BC4-BDDC-762C508A952B'),
}

model ModifyLogHubStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyLogHubStatusResponseBody(name='body'),
}

/**
 * @summary Changes the status of a log shipping job.
 *
 * @param request ModifyLogHubStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyLogHubStatusResponse
 */
async function modifyLogHubStatusWithOptions(request: ModifyLogHubStatusRequest, runtime: Util.RuntimeOptions): ModifyLogHubStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.deliverName)) {
    query['DeliverName'] = request.deliverName;
  }
  if (!Util.isUnset(request.logStoreName)) {
    query['LogStoreName'] = request.logStoreName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.projectName)) {
    query['ProjectName'] = request.projectName;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyLogHubStatus',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the status of a log shipping job.
 *
 * @param request ModifyLogHubStatusRequest
 * @return ModifyLogHubStatusResponse
 */
async function modifyLogHubStatus(request: ModifyLogHubStatusRequest): ModifyLogHubStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyLogHubStatusWithOptions(request, runtime);
}

model ModifyMaintenanceActionRequest {
  ids?: string(name='Ids', description='The ID of the pending O\\\\&M event. You can specify multiple IDs to batch change the switchover time. Separate multiple IDs with commas (,).
> - You can call the [DescribeMaintenanceAction](https://help.aliyun.com/document_detail/271738.html) operation to query the information about pending O\\\\&M events, including the event ID.
> - You can change the switchover time only for pending O\\\\&M events. The switchover time of historical O\\\\&M events cannot be changed. For more information about the status of pending and historical O\\\\&M events, see [DescribeMaintenanceAction](https://help.aliyun.com/document_detail/271738.html).

This parameter is required.', example='11111'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The ID of the region where the pending O\\\\&M event occurs.

> - You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-4690g37929XXXX'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  switchTime?: string(name='SwitchTime', description='The point in time when you want the system to perform operations on the pending O\\\\&M event. Specify the time in the ISO 8601 standard in the `yyyy-MM-ddTHH:mm:ssZ` format. The time must be in UTC.

This parameter is required.', example='2021-07-09T22:00:00Z'),
}

model ModifyMaintenanceActionResponseBody = {
  ids?: string(name='Ids', description='The O\\\\&M event ID.', example='11111'),
  requestId?: string(name='RequestId', description='The request ID.', example='7856CBE7-5BD0-4EE1-AC62-749392******'),
}

model ModifyMaintenanceActionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyMaintenanceActionResponseBody(name='body'),
}

/**
 * @summary Changes the switchover time of O&M events.
 *
 * @param request ModifyMaintenanceActionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyMaintenanceActionResponse
 */
async function modifyMaintenanceActionWithOptions(request: ModifyMaintenanceActionRequest, runtime: Util.RuntimeOptions): ModifyMaintenanceActionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ids)) {
    query['Ids'] = request.ids;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.switchTime)) {
    query['SwitchTime'] = request.switchTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyMaintenanceAction',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Changes the switchover time of O&M events.
 *
 * @param request ModifyMaintenanceActionRequest
 * @return ModifyMaintenanceActionResponse
 */
async function modifyMaintenanceAction(request: ModifyMaintenanceActionRequest): ModifyMaintenanceActionResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyMaintenanceActionWithOptions(request, runtime);
}

model ModifyResubmitConfigRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-uf6wjk5xxxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-4690g37929****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  rules?: [ 
    {
      exceedMemoryException?: boolean(name='ExceedMemoryException', description='Specifies whether to configure out-of-memory (OOM) check.', example='false'),
      groupName?: string(name='GroupName', description='The name of the source resource group.', example='test2'),
      peakMemory?: string(name='PeakMemory', description='The peak memory usage.', example='32'),
      queryTime?: string(name='QueryTime', description='The duration of the SQL statement. Unit: milliseconds.', example='300'),
      targetGroupName?: string(name='TargetGroupName', description='The name of the destination resource group.', example='test_target_group'),
    }
  ](name='Rules', description='The job resubmission rules.

This parameter is required.'),
}

model ModifyResubmitConfigShrinkRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-uf6wjk5xxxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-4690g37929****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  rulesShrink?: string(name='Rules', description='The job resubmission rules.

This parameter is required.'),
}

model ModifyResubmitConfigResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model ModifyResubmitConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyResubmitConfigResponseBody(name='body'),
}

/**
 * @summary 修改Resubmit配置
 *
 * @param tmpReq ModifyResubmitConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyResubmitConfigResponse
 */
async function modifyResubmitConfigWithOptions(tmpReq: ModifyResubmitConfigRequest, runtime: Util.RuntimeOptions): ModifyResubmitConfigResponse {
  Util.validateModel(tmpReq);
  var request = new ModifyResubmitConfigShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.rules)) {
    request.rulesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.rules, 'Rules', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.rulesShrink)) {
    query['Rules'] = request.rulesShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyResubmitConfig',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改Resubmit配置
 *
 * @param request ModifyResubmitConfigRequest
 * @return ModifyResubmitConfigResponse
 */
async function modifyResubmitConfig(request: ModifyResubmitConfigRequest): ModifyResubmitConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyResubmitConfigWithOptions(request, runtime);
}

model ModifySQAConfigRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='am-8vb369k7zxdt10tz0'),
  groupName?: string(name='GroupName', description='The name of the resource group.

>  You can call the [DescribeDBResourceGroup](https://help.aliyun.com/document_detail/459446.html) operation to query the resource group name of a cluster.

This parameter is required.', example='test'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-4690g37929****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  SQAStatus?: string(name='SQAStatus', description='Specifies whether to enable short query acceleration (SQA).

This parameter is required.', example='off'),
}

model ModifySQAConfigResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='494486CE-6F49-574E-B304-29127EA12E36'),
}

model ModifySQAConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifySQAConfigResponseBody(name='body'),
}

/**
 * @summary 修改SQA配置
 *
 * @param request ModifySQAConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifySQAConfigResponse
 */
async function modifySQAConfigWithOptions(request: ModifySQAConfigRequest, runtime: Util.RuntimeOptions): ModifySQAConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.SQAStatus)) {
    query['SQAStatus'] = request.SQAStatus;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySQAConfig',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改SQA配置
 *
 * @param request ModifySQAConfigRequest
 * @return ModifySQAConfigResponse
 */
async function modifySQAConfig(request: ModifySQAConfigRequest): ModifySQAConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySQAConfigWithOptions(request, runtime);
}

model ModifySyncJobRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a region.

This parameter is required.', example='am-bp12bh6z59nh8497f'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sourceDBCluster?: [ 
    {
      clusterIds?: string(name='ClusterIds', description='The ID of the source instance or cluster. Separate multiple IDs with commas (,).

This parameter is required.', example='rm-2zepqn129i9s3l2z3,rm-2zea4dj583129ksp6'),
      jobId?: string(name='JobId', description='The ID of the synchronization job.', example='dts-xxxxxx'),
      operateType?: string(name='OperateType', description='The operation type.

Valid values:

*   Create
*   Modify

This parameter is required.', example='Create'),
      regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
      type?: string(name='Type', description='The source database type.

Valid values:

*   rds: ApsaraDB RDS.
*   sls: Simple Log Service.
*   polardb: PolarDB.

This parameter is required.', example='sls'),
    }
  ](name='SourceDBCluster', description='The source instances or clusters.', nullable=true),
  syncPlatform?: string(name='SyncPlatform', description='The synchronization platform.', example='ADB-CDC'),
}

model ModifySyncJobResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='5AD3D9DF-614F-5B97-9522-A2406A432012'),
}

model ModifySyncJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifySyncJobResponseBody(name='body'),
}

/**
 * @summary Modifies the synchronization jobs for an AnalyticDB for MySQL cluster.
 *
 * @param request ModifySyncJobRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifySyncJobResponse
 */
async function modifySyncJobWithOptions(request: ModifySyncJobRequest, runtime: Util.RuntimeOptions): ModifySyncJobResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sourceDBCluster)) {
    query['SourceDBCluster'] = request.sourceDBCluster;
  }
  if (!Util.isUnset(request.syncPlatform)) {
    query['SyncPlatform'] = request.syncPlatform;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySyncJob',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies the synchronization jobs for an AnalyticDB for MySQL cluster.
 *
 * @param request ModifySyncJobRequest
 * @return ModifySyncJobResponse
 */
async function modifySyncJob(request: ModifySyncJobRequest): ModifySyncJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySyncJobWithOptions(request, runtime);
}

model OperateLogHubRequest {
  create?: boolean(name='Create', description='Specifies whether to create the log shipping job.

This parameter is required.', example='true'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition clusters within a region.

This parameter is required.', example='am-uf6rtqaj25491628z'),
  deliverName?: string(name='DeliverName', description='The name of the log shipping job.

This parameter is required.', example='xhxsblz_limited_gift_pay'),
  deliverTime?: string(name='DeliverTime', description='The shipping time.

This parameter is required.', example='2024-10-24\\\\"T\\\\"13:10\\\\"Z\\\\"'),
  description?: string(name='Description', description='The description of the log shipping job.

This parameter is required.', example='test'),
  filterDirtyData?: boolean(name='FilterDirtyData', description='Specifies whether to filter dirty data.

Valid values:

*   true
*   false', example='false'),
  logHubStores?: [ 
    {
      fieldKey?: string(name='FieldKey', description='The value of the log keyword.

This parameter is required.', example='testValue'),
      logKey?: string(name='LogKey', description='The log keyword.

This parameter is required.', example='testKey'),
    }
  ](name='LogHubStores', description='The log keywords.

This parameter is required.'),
  logStoreName?: string(name='LogStoreName', description='The name of the Logstore.

This parameter is required.', example='beta-game-mjxb-ham-pool-export'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  password?: string(name='Password', description='The password of the database account.

This parameter is required.', example='ads_123'),
  projectName?: string(name='ProjectName', description='The name of the Simple Log Service project.

This parameter is required.', example='test-adb'),
  provider?: string(name='Provider', description='The channel of the log shipping job.', example='SLS'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  schemaName?: string(name='SchemaName', description='The name of the database.

This parameter is required.', example='wddata'),
  tableName?: string(name='TableName', description='The name of the table.

This parameter is required.', example='rest_action_latest'),
  userName?: string(name='UserName', description='The name of the database account.

This parameter is required.', example='admin'),
}

model OperateLogHubResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='71B41FF9-1275-5F75-973D-8BC3C60236E6'),
}

model OperateLogHubResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OperateLogHubResponseBody(name='body'),
}

/**
 * @summary 修改LogHub投递规则
 *
 * @param request OperateLogHubRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return OperateLogHubResponse
 */
async function operateLogHubWithOptions(request: OperateLogHubRequest, runtime: Util.RuntimeOptions): OperateLogHubResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.create)) {
    query['Create'] = request.create;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.deliverName)) {
    query['DeliverName'] = request.deliverName;
  }
  if (!Util.isUnset(request.deliverTime)) {
    query['DeliverTime'] = request.deliverTime;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.filterDirtyData)) {
    query['FilterDirtyData'] = request.filterDirtyData;
  }
  if (!Util.isUnset(request.logHubStores)) {
    query['LogHubStores'] = request.logHubStores;
  }
  if (!Util.isUnset(request.logStoreName)) {
    query['LogStoreName'] = request.logStoreName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.password)) {
    query['Password'] = request.password;
  }
  if (!Util.isUnset(request.projectName)) {
    query['ProjectName'] = request.projectName;
  }
  if (!Util.isUnset(request.provider)) {
    query['Provider'] = request.provider;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.schemaName)) {
    query['SchemaName'] = request.schemaName;
  }
  if (!Util.isUnset(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'OperateLogHub',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改LogHub投递规则
 *
 * @param request OperateLogHubRequest
 * @return OperateLogHubResponse
 */
async function operateLogHub(request: OperateLogHubRequest): OperateLogHubResponse {
  var runtime = new Util.RuntimeOptions{};
  return operateLogHubWithOptions(request, runtime);
}

model ReleaseClusterPublicConnectionRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='am-bp1xxxxxxxx47'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ReleaseClusterPublicConnectionResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model ReleaseClusterPublicConnectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReleaseClusterPublicConnectionResponseBody(name='body'),
}

/**
 * @summary Releases the public endpoint of an AnalyticDB for MySQL cluster.
 *
 * @param request ReleaseClusterPublicConnectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReleaseClusterPublicConnectionResponse
 */
async function releaseClusterPublicConnectionWithOptions(request: ReleaseClusterPublicConnectionRequest, runtime: Util.RuntimeOptions): ReleaseClusterPublicConnectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReleaseClusterPublicConnection',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Releases the public endpoint of an AnalyticDB for MySQL cluster.
 *
 * @param request ReleaseClusterPublicConnectionRequest
 * @return ReleaseClusterPublicConnectionResponse
 */
async function releaseClusterPublicConnection(request: ReleaseClusterPublicConnectionRequest): ReleaseClusterPublicConnectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return releaseClusterPublicConnectionWithOptions(request, runtime);
}

model ResetAccountPasswordRequest {
  accountName?: string(name='AccountName', description='The name of the database account.

This parameter is required.', example='test_accout'),
  accountPassword?: string(name='AccountPassword', description='The password of the database account.

*   The password can contain uppercase letters, lowercase letters, digits, and special characters.
*   Special characters include ! @ # $ % ^ & \\\\* ( ) _ + - =
*   The password must be 8 to 32 characters in length.

This parameter is required.', example='Test_accout1'),
  accountType?: string(name='AccountType', description='1.  Normal: the standard account.
2.  Super: the privileged account.', example='Normal'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='rm-uf6wjk5xxxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ResetAccountPasswordResponseBody = {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='rm-uf6wjk5xxxxxxxxxx'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
  taskId?: int32(name='TaskId', description='The task ID.', example='1564657730'),
}

model ResetAccountPasswordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResetAccountPasswordResponseBody(name='body'),
}

/**
 * @summary Resets the password of a database account for an AnalyticDB for MySQL cluster.
 *
 * @param request ResetAccountPasswordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResetAccountPasswordResponse
 */
async function resetAccountPasswordWithOptions(request: ResetAccountPasswordRequest, runtime: Util.RuntimeOptions): ResetAccountPasswordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.accountPassword)) {
    query['AccountPassword'] = request.accountPassword;
  }
  if (!Util.isUnset(request.accountType)) {
    query['AccountType'] = request.accountType;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ResetAccountPassword',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Resets the password of a database account for an AnalyticDB for MySQL cluster.
 *
 * @param request ResetAccountPasswordRequest
 * @return ResetAccountPasswordResponse
 */
async function resetAccountPassword(request: ResetAccountPasswordRequest): ResetAccountPasswordResponse {
  var runtime = new Util.RuntimeOptions{};
  return resetAccountPasswordWithOptions(request, runtime);
}

model RevokeOperatorPermissionRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the cluster.

This parameter is required.', example='rm-uf6wjk5xxxxxxxxxx'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model RevokeOperatorPermissionResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model RevokeOperatorPermissionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RevokeOperatorPermissionResponseBody(name='body'),
}

/**
 * @summary 取消服务帐号授权
 *
 * @param request RevokeOperatorPermissionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RevokeOperatorPermissionResponse
 */
async function revokeOperatorPermissionWithOptions(request: RevokeOperatorPermissionRequest, runtime: Util.RuntimeOptions): RevokeOperatorPermissionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RevokeOperatorPermission',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 取消服务帐号授权
 *
 * @param request RevokeOperatorPermissionRequest
 * @return RevokeOperatorPermissionResponse
 */
async function revokeOperatorPermission(request: RevokeOperatorPermissionRequest): RevokeOperatorPermissionResponse {
  var runtime = new Util.RuntimeOptions{};
  return revokeOperatorPermissionWithOptions(request, runtime);
}

model TagResourcesRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID of the cluster. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='The ID of the cluster to which to add a tag. If you want to add a tag to multiple clusters, click **Add** and enter the cluster IDs.

> 

*   You can add tags to up to 50 clusters at a time.

*   You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the information about all AnalyticDB for MySQL clusters within a region, including cluster IDs.

This parameter is required.', example='am-bp1xxx.1'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType', description='The type of the cluster. Set the value to **ALIYUN::ADB::CLUSTER**.

This parameter is required.', example='ALIYUN::ADB::CLUSTER'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag. If you want to add multiple tags to a single cluster at a time, click **Add** and enter tag keys and values.

> You can add up to 20 tags at a time.', example='testkey1'),
      value?: string(name='Value', description='The value of the tag. If you want to add multiple tags to a single cluster at a time, click **Add** and enter tag keys and values.

> You can add up to 20 tags at a time.', example='testvalue1'),
    }
  ](name='Tag', description='The tags to add to the cluster.

This parameter is required.'),
}

model TagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='863D51B7-5321-41D8-A0B6-A088B0450EFD'),
}

model TagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TagResourcesResponseBody(name='body'),
}

/**
 * @summary Adds tags to an AnalyticDB for MySQL cluster.
 *
 * @param request TagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TagResourcesResponse
 */
async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: Util.RuntimeOptions): TagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TagResources',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds tags to an AnalyticDB for MySQL cluster.
 *
 * @param request TagResourcesRequest
 * @return TagResourcesResponse
 */
async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return tagResourcesWithOptions(request, runtime);
}

model UnbindDBResourceGroupWithUserRequest {
  clientToken?: string(name='ClientToken'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

> You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='am-bp1ub9grke1****'),
  groupName?: string(name='GroupName', description='The name of the resource group.

This parameter is required.', example='test'),
  groupUser?: string(name='GroupUser', description='The database account with which the resource group is associated.

This parameter is required.', example='accout'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model UnbindDBResourceGroupWithUserResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model UnbindDBResourceGroupWithUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnbindDBResourceGroupWithUserResponseBody(name='body'),
}

/**
 * @summary Disassociates a resource group of an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster from a database account.
 *
 * @param request UnbindDBResourceGroupWithUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnbindDBResourceGroupWithUserResponse
 */
async function unbindDBResourceGroupWithUserWithOptions(request: UnbindDBResourceGroupWithUserRequest, runtime: Util.RuntimeOptions): UnbindDBResourceGroupWithUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.groupUser)) {
    query['GroupUser'] = request.groupUser;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UnbindDBResourceGroupWithUser',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disassociates a resource group of an AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster from a database account.
 *
 * @param request UnbindDBResourceGroupWithUserRequest
 * @return UnbindDBResourceGroupWithUserResponse
 */
async function unbindDBResourceGroupWithUser(request: UnbindDBResourceGroupWithUserRequest): UnbindDBResourceGroupWithUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return unbindDBResourceGroupWithUserWithOptions(request, runtime);
}

model UnbindDBResourcePoolWithUserRequest {
  clientToken?: string(name='ClientToken'),
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/129857.html) operation to query the cluster IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='am-bpxxxxxxxx47'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  poolName?: string(name='PoolName', description='The name of the resource group.

This parameter is required.', example='test'),
  poolUser?: string(name='PoolUser', description='The database account with which the resource group is associated.

This parameter is required.', example='testb'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model UnbindDBResourcePoolWithUserResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model UnbindDBResourcePoolWithUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UnbindDBResourcePoolWithUserResponseBody(name='body'),
}

/**
 * @summary Disassociates a database account from a resource group. This operation can be called only for AnalyticDB for MySQL clusters in elastic mode for Cluster Edition.
 *
 * @param request UnbindDBResourcePoolWithUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UnbindDBResourcePoolWithUserResponse
 */
async function unbindDBResourcePoolWithUserWithOptions(request: UnbindDBResourcePoolWithUserRequest, runtime: Util.RuntimeOptions): UnbindDBResourcePoolWithUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.poolName)) {
    query['PoolName'] = request.poolName;
  }
  if (!Util.isUnset(request.poolUser)) {
    query['PoolUser'] = request.poolUser;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UnbindDBResourcePoolWithUser',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disassociates a database account from a resource group. This operation can be called only for AnalyticDB for MySQL clusters in elastic mode for Cluster Edition.
 *
 * @param request UnbindDBResourcePoolWithUserRequest
 * @return UnbindDBResourcePoolWithUserResponse
 */
async function unbindDBResourcePoolWithUser(request: UnbindDBResourcePoolWithUserRequest): UnbindDBResourcePoolWithUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return unbindDBResourcePoolWithUserWithOptions(request, runtime);
}

model UntagResourcesRequest {
  all?: boolean(name='All', description='Specifies whether to remove all tags from clusters. Default value: false. Valid values:

*   **true**
*   **false**

>  If you specify TagKey and this parameter, this parameter does not take effect.', example='false'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', description='The region ID.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='The ID of cluster N. Valid values of N: 1 to 50.

This parameter is required.', example='am-bp1xxx.1'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType', description='The resource type. Set the value to **ALIYUN::ADB::CLUSTER**.

This parameter is required.', example='ALIYUN::ADB::CLUSTER'),
  tagKey?: [ string ](name='TagKey', description='The key of tag N. Valid values of N: 1 to 20.', example='a'),
}

model UntagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='2D69A58F-345C-4FDE-88E4-BF5189484043'),
}

model UntagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UntagResourcesResponseBody(name='body'),
}

/**
 * @summary Removes all tags from AnalyticDB for MySQL clusters.
 *
 * @param request UntagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UntagResourcesResponse
 */
async function untagResourcesWithOptions(request: UntagResourcesRequest, runtime: Util.RuntimeOptions): UntagResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.all)) {
    query['All'] = request.all;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.tagKey)) {
    query['TagKey'] = request.tagKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UntagResources',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Removes all tags from AnalyticDB for MySQL clusters.
 *
 * @param request UntagResourcesRequest
 * @return UntagResourcesResponse
 */
async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return untagResourcesWithOptions(request, runtime);
}

model UpgradeKernelVersionRequest {
  DBClusterId?: string(name='DBClusterId', description='The ID of the AnalyticDB for MySQL Data Warehouse Edition (V3.0) cluster.

>  You can call the [DescribeDBClusters](https://help.aliyun.com/document_detail/612241.html) operation to query the cluster IDs of all AnalyticDB for MySQL Data Warehouse Edition (V3.0) clusters within a region.

This parameter is required.', example='am-uf6g8w25jacm7****'),
  DBVersion?: string(name='DBVersion', description='The minor version to which you want to update.

>  You can call the **DescribeKernelVersion** operation to query the supported minor versions.', example='3.1.9'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  switchMode?: int32(name='SwitchMode', description='The time when to perform the update. Valid values:

*   **0** (default): immediately performs the update.
*   **1**: performs the update during the maintenance window.

>  You can call the [ModifyDBClusterMaintainTime](https://help.aliyun.com/document_detail/612236.html) operation to modify the maintenance window of an AnalyticDB for MySQL cluster.', example='0'),
}

model UpgradeKernelVersionResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='1AD222E9-E606-4A42-BF6D-8A4442913CEF'),
}

model UpgradeKernelVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpgradeKernelVersionResponseBody(name='body'),
}

/**
 * @summary Updates the minor version of an AnalyticDB for MySQL cluster.
 *
 * @param request UpgradeKernelVersionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpgradeKernelVersionResponse
 */
async function upgradeKernelVersionWithOptions(request: UpgradeKernelVersionRequest, runtime: Util.RuntimeOptions): UpgradeKernelVersionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.DBVersion)) {
    query['DBVersion'] = request.DBVersion;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.switchMode)) {
    query['SwitchMode'] = request.switchMode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpgradeKernelVersion',
    version = '2019-03-15',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the minor version of an AnalyticDB for MySQL cluster.
 *
 * @param request UpgradeKernelVersionRequest
 * @return UpgradeKernelVersionResponse
 */
async function upgradeKernelVersion(request: UpgradeKernelVersionRequest): UpgradeKernelVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  return upgradeKernelVersionWithOptions(request, runtime);
}

